robinmia commited on
Commit
c8b1a0f
·
verified ·
1 Parent(s): 65217b6
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -1,7 +1,13 @@
 
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
 
 
 
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  demo.launch()
 
1
+ import whisper
2
  import gradio as gr
3
 
4
+ def getSubTitle(audio_file):
5
+ import whisper
6
+ model = whisper.load_model("base")
7
+ audio = whisper.load_audio(audio_file)
8
+ result = model.transcribe(audio)['segments']
9
+ return result
10
+
11
+ demo = gr.Interface(fn=getSubTitle, inputs=gr.Audio(type="filepath"), outputs=["text"])
12
 
 
13
  demo.launch()