beeguy commited on
Commit
97163f6
·
1 Parent(s): 625d542

other pipe

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -4,12 +4,17 @@ from transformers import pipeline
4
 
5
  st.title("Speech to Text")
6
 
7
- audio_to_text = pipeline("automatic-speech-recognition")
8
 
 
9
  audio_file = st.file_uploader("Upload an audio file", type=["wav", "mp3", "ogg", "m4a"])
10
 
 
 
11
  if audio_file:
12
- text = audio_to_text(audio_file)
 
 
 
13
  if text:
14
  st.write("Here is the text:")
15
  st.write(text)
 
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
+
12
+
13
  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)