espejelomar commited on
Commit
2dd3ac9
1 Parent(s): ca75486

Create new file

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+ import time
4
+
5
+ modelo = pipeline("automatic-speech-recognition", model = "facebook/wav2vec2-large-xlsr-53-spanish")
6
+
7
+ def transcribe(audio):
8
+ time.sleep(2)
9
+ text = modelo(audio)["text"]
10
+ return text
11
+
12
+ gr.Interface(
13
+ fn=transcribe,
14
+ inputs=[
15
+ gr.Audio(source="microphone", type="filepath")
16
+ ],
17
+ outputs=[
18
+ "textbox",
19
+ ],
20
+ live=True,).launch(share=True)