nickmuchi commited on
Commit
a31e67a
1 Parent(s): b30ce91

Update functions.py

Browse files
Files changed (1) hide show
  1. functions.py +3 -3
functions.py CHANGED
@@ -42,7 +42,7 @@ def load_models():
42
 
43
  @st.experimental_singleton(suppress_st_warning=True)
44
  def load_asr_model(asr_model_name):
45
- asr_model = whisper.load_model(asr_model_name, task='transcribe', language='en')
46
 
47
  return asr_model
48
 
@@ -66,12 +66,12 @@ def inference(link, upload, _asr_model):
66
  yt = YouTube(link)
67
  title = yt.title
68
  path = yt.streams.filter(only_audio=True)[0].download(filename="audio.mp4")
69
- results = _asr_model.transcribe(path)
70
 
71
  return results['text'], yt.title
72
 
73
  elif upload:
74
- results = _asr_model.trasncribe(upload)
75
 
76
  return results['text'], "Transcribed Earnings Audio"
77
 
 
42
 
43
  @st.experimental_singleton(suppress_st_warning=True)
44
  def load_asr_model(asr_model_name):
45
+ asr_model = whisper.load_model(asr_model_name)
46
 
47
  return asr_model
48
 
 
66
  yt = YouTube(link)
67
  title = yt.title
68
  path = yt.streams.filter(only_audio=True)[0].download(filename="audio.mp4")
69
+ results = _asr_model.transcribe(path, task='transcribe', language='en')
70
 
71
  return results['text'], yt.title
72
 
73
  elif upload:
74
+ results = _asr_model.trasncribe(upload, task='transcribe', language='en')
75
 
76
  return results['text'], "Transcribed Earnings Audio"
77