Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
+
from transformers import pipeline
|
| 6 |
+
|
| 7 |
+
p = pipeline(model="Distay/whisper-tiny")
|
| 8 |
+
|
| 9 |
+
def transcribe(audio):
|
| 10 |
+
text = p(audio)["text"]
|
| 11 |
+
return text
|
| 12 |
|
| 13 |
+
gr.Interface(
|
| 14 |
+
fn=transcribe,
|
| 15 |
+
inputs=gr.Audio(source="microphone", type="filepath"),
|
| 16 |
+
outputs="text",live=True,auto_submit=True,
|
| 17 |
+
auto_submit_duration=5).launch()
|