Spaces:
Runtime error
Runtime error
Commit Β·
a4e0cca
1
Parent(s): 65a3095
Modelo de Voz a Texto
Browse files- Facebook wav2vec model
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def transcribe(audio):
|
| 6 |
+
text = modelo(audio)["text"]
|
| 7 |
+
return text
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
if __name__ == '__main__':
|
| 11 |
+
modelo = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-large-xlsr-53-spanish")
|
| 12 |
+
|
| 13 |
+
gr.Interface(
|
| 14 |
+
fn=transcribe,
|
| 15 |
+
inputs=[gr.Audio(source="microphone", type="filepath")],
|
| 16 |
+
outputs=["textbox"]
|
| 17 |
+
).launch()
|