Spaces:
Build error
Build error
Download app.py from robinmia/subtitle_gen: direct link, hf CLI and curl.
- Browser
- Download file 318 Bytes
-
https://huggingface.co/spaces/robinmia/subtitle_gen/resolve/main/app.py
- Command line
-
hf download hf://spaces/robinmia/subtitle_gen/app.py
-
curl -L -o app.py https://huggingface.co/spaces/robinmia/subtitle_gen/resolve/main/app.py
318 Bytes
| import whisper | |
| import gradio as gr | |
| def getSubTitle(audio_file): | |
| model = whisper.load_model("base") | |
| audio = whisper.load_audio(audio_file) | |
| result = model.transcribe(audio)['segments'] | |
| return result | |
| demo = gr.Interface(fn=getSubTitle, inputs=gr.Audio(type="filepath"), outputs=["text"]) | |
| demo.launch() | |