Metantropia commited on
Commit
0c0198e
·
verified ·
1 Parent(s): ecdd56f

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+ modelo=pipeline("automatic-speech-recognition",model="facebook/wav2vec2-large-xlar-53-spanish")
4
+ def transcribe(audio):
5
+ text=modelo(audio)["texto"]
6
+ return text
7
+
8
+ gr.Interface(
9
+ fn=transcribe,
10
+ inputs=[gr.Audio(source="microphone",type="filepath")],
11
+ ).launch()