kenkina commited on
Commit
503d1ea
1 Parent(s): a476db8

Create app.py

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