Spaces:
Runtime error
Runtime error
simple asr no streaming
Browse files
app.py
CHANGED
|
@@ -3,19 +3,12 @@ from transformers import pipeline
|
|
| 3 |
|
| 4 |
p = pipeline("automatic-speech-recognition", model='openai/whisper-small')
|
| 5 |
|
| 6 |
-
def transcribe(audio
|
| 7 |
-
text = p(audio)
|
| 8 |
-
|
| 9 |
-
return state, state
|
| 10 |
|
| 11 |
gr.Interface(
|
| 12 |
fn=transcribe,
|
| 13 |
-
inputs=
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
],
|
| 17 |
-
outputs=[
|
| 18 |
-
"textbox",
|
| 19 |
-
"state"
|
| 20 |
-
],
|
| 21 |
-
live=True).launch()
|
|
|
|
| 3 |
|
| 4 |
p = pipeline("automatic-speech-recognition", model='openai/whisper-small')
|
| 5 |
|
| 6 |
+
def transcribe(audio):
|
| 7 |
+
text = p(audio)["text"]
|
| 8 |
+
return text
|
|
|
|
| 9 |
|
| 10 |
gr.Interface(
|
| 11 |
fn=transcribe,
|
| 12 |
+
inputs=gr.Audio(source="microphone", type="filepath"),
|
| 13 |
+
outputs="text").launch()
|
| 14 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|