Spaces:
Running
Running
from url
Browse files
app.py
CHANGED
@@ -1,20 +1,18 @@
|
|
1 |
import streamlit as st
|
2 |
-
import pydub as pd
|
3 |
from transformers import pipeline
|
4 |
|
5 |
|
6 |
st.title("Speech to Text")
|
7 |
|
8 |
-
|
|
|
|
|
9 |
|
10 |
|
11 |
|
12 |
if audio_file:
|
13 |
# to flac
|
14 |
-
|
15 |
-
transcriber = pipeline(model="openai/whisper-medium")
|
16 |
-
|
17 |
-
text = transcriber(flac_file)
|
18 |
if text:
|
19 |
st.write("Here is the text:")
|
20 |
st.write(text)
|
|
|
1 |
import streamlit as st
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
|
5 |
st.title("Speech to Text")
|
6 |
|
7 |
+
transcriber = pipeline(model="openai/whisper-medium")
|
8 |
+
# audio_file = st.file_uploader("Upload an audio file")
|
9 |
+
audio_file = "https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac"
|
10 |
|
11 |
|
12 |
|
13 |
if audio_file:
|
14 |
# to flac
|
15 |
+
text = transcriber(audio_file)
|
|
|
|
|
|
|
16 |
if text:
|
17 |
st.write("Here is the text:")
|
18 |
st.write(text)
|