Spaces:
Runtime error
Runtime error
lhzstar
commited on
Commit
·
3e6feb3
1
Parent(s):
84660f7
new commits
Browse files
utils.py
CHANGED
@@ -3,7 +3,6 @@ import spacy
|
|
3 |
import json
|
4 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, AutoModelForCausalLM, AutoModel
|
5 |
import streamlit as st
|
6 |
-
import whisper
|
7 |
|
8 |
he_regex = re.compile(r'\b(he|him|himself)\b', flags=re.IGNORECASE)
|
9 |
his_regex = re.compile(r'\b(his)\b', flags=re.IGNORECASE)
|
@@ -19,14 +18,6 @@ def hide_footer():
|
|
19 |
"""
|
20 |
st.markdown(hide_st_style, unsafe_allow_html=True)
|
21 |
|
22 |
-
@st.cache_resource
|
23 |
-
def get_whisper_model(model_url:str='tiny'):
|
24 |
-
print("--------------------------------------------")
|
25 |
-
print("Attempting to load Whisper ...")
|
26 |
-
model = whisper.load_model(model_url, device='cpu')
|
27 |
-
print("Succesfully loaded Whisper")
|
28 |
-
return model
|
29 |
-
|
30 |
@st.cache_resource
|
31 |
def get_seq2seq_model(model_id):
|
32 |
return AutoModelForSeq2SeqLM.from_pretrained(model_id)
|
|
|
3 |
import json
|
4 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, AutoModelForCausalLM, AutoModel
|
5 |
import streamlit as st
|
|
|
6 |
|
7 |
he_regex = re.compile(r'\b(he|him|himself)\b', flags=re.IGNORECASE)
|
8 |
his_regex = re.compile(r'\b(his)\b', flags=re.IGNORECASE)
|
|
|
18 |
"""
|
19 |
st.markdown(hide_st_style, unsafe_allow_html=True)
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
@st.cache_resource
|
22 |
def get_seq2seq_model(model_id):
|
23 |
return AutoModelForSeq2SeqLM.from_pretrained(model_id)
|