Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
|
5 |
+
modelo = pipeline("automatic-speech-recognition", model = "facebook/wav2vec2-large-xlsr-53-spanish")
|
6 |
+
|
7 |
+
def transcribe(audio):
|
8 |
+
text = modelo(audio)["text"]
|
9 |
+
return text
|
10 |
+
|
11 |
+
gr.Interface(
|
12 |
+
fn = transcribe,
|
13 |
+
inputs = [ gr.Audio(source="microphone", type="filepath") ],
|
14 |
+
outputs = ["textbox"]
|
15 |
+
).launch()
|