jeraldflowers commited on
Commit
4f70ec5
·
1 Parent(s): fb0044c
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ pip install git+https://github.com/huggingface/transformers
2
+
3
+ from transformers import pipeline
4
+ import gradio as gr
5
+
6
+ model = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-large-xlsr-53-spanish")
7
+
8
+ def transcribe(audio):
9
+ text = model(audio)["text"]
10
+ return text
11
+
12
+ gr.Interface(
13
+ fn=transcribe,
14
+ inputs=[gr.Audio(source="microphone", type="filepath")],
15
+ outputs=["textbox"],
16
+ ).launch()