Spaces:
Sleeping
Sleeping
app.py
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|