beeguy commited on
Commit
606e097
·
1 Parent(s): 97163f6
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -4,8 +4,7 @@ from transformers import pipeline
4
 
5
  st.title("Speech to Text")
6
 
7
-
8
- pipe = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-base-960h")
9
  audio_file = st.file_uploader("Upload an audio file", type=["wav", "mp3", "ogg", "m4a"])
10
 
11
 
@@ -14,7 +13,7 @@ if audio_file:
14
  # convert audio file m4a to wav
15
  # audio_file = convert_audio(audio_file)
16
 
17
- text = pipe(audio_file)
18
  if text:
19
  st.write("Here is the text:")
20
  st.write(text)
 
4
 
5
  st.title("Speech to Text")
6
 
7
+ transcriber = pipeline(model="openai/whisper-large-v2")
 
8
  audio_file = st.file_uploader("Upload an audio file", type=["wav", "mp3", "ogg", "m4a"])
9
 
10
 
 
13
  # convert audio file m4a to wav
14
  # audio_file = convert_audio(audio_file)
15
 
16
+ text = transcriber(audio_file)
17
  if text:
18
  st.write("Here is the text:")
19
  st.write(text)