Ichcanziho commited on
Commit
a4e0cca
β€’
1 Parent(s): 65a3095

Modelo de Voz a Texto

Browse files

- Facebook wav2vec model

Files changed (1) hide show
  1. app.py +17 -0
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()