Spaces:
Sleeping
Sleeping
Update app.py for ASR test with Whisper
Browse files
app.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
|
4 |
+
asr_pipeline = pipeline("automatic-speech-recognition", model="openai/whisper-small")
|
|
|
5 |
|
6 |
+
def transcribe(audio):
|
7 |
+
text = asr_pipeline(audio)["text"]
|
8 |
+
return text
|
9 |
+
|
10 |
+
demo = gr.Interface(fn=transcribe, inputs=gr.Audio(type="filepath"), outputs="text")
|
11 |
+
demo.launch()
|