Tlanextli commited on
Commit
3198280
·
1 Parent(s): 1e901d8

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import gradio as gr
3
+ from transformers import pipeline
4
+
5
+
6
+ pipeline = pipeline(task="automatic-speech-recognition", model="openai/whisper-large")
7
+
8
+ def transcribe(audiofile):
9
+ transcription = pipeline(audiofile)
10
+ return transcription
11
+
12
+
13
+ demo = gr.Interface(
14
+ fn=transcribe,
15
+ inputs="microphone",
16
+ #inputs=gr.inputs.Audio(label="Upload audio file", type="filepath"),
17
+ outputs="text"
18
+ )
19
+
20
+
21
+ if __name__ == "__main__":
22
+ demo.launch()