Spaces:
Running
Running
other pipe
Browse files
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 |
-
|
|
|
|
|
|
|
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)
|