alviadn commited on
Commit
19525d4
β€’
1 Parent(s): cd990db
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+
5
+ model = pipeline(task="automatic-speech-recognition",
6
+ model="facebook/s2t-medium-librispeech-asr")
7
+
8
+
9
+ def predict_speech_to_text(audio):
10
+ prediction = model(audio)
11
+ text = prediction['text']
12
+ return text
13
+
14
+
15
+ gr.Interface(fn=predict_speech_to_text,
16
+ title="πŸ§‘πŸ½β€πŸŽ€ PROLOVE πŸ₯°πŸ˜˜ ",
17
+ inputs=gr.inputs.Audio(
18
+ source="microphone", type="filepath", label="Input"),
19
+ outputs=gr.outputs.Textbox(label="Output"),
20
+ description="Using pipeline with Facebook S2T for ASR.",
21
+ examples=['ljspeech.wav'],
22
+ allow_flagging='never'
23
+ ).launch()