Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
model = pipeline("automatic-speech-recognition")
|
| 5 |
+
|
| 6 |
+
def transcribe_audio(audio):
|
| 7 |
+
transcription = model(audio)["text"]
|
| 8 |
+
return transcription
|
| 9 |
+
|
| 10 |
+
gr.Interface(
|
| 11 |
+
fn=transcribe_audio,
|
| 12 |
+
inputs=gr.Audio(type="filepath"),
|
| 13 |
+
outputs="text",
|
| 14 |
+
).launch()
|