Spaces:
Sleeping
Sleeping
| import os | |
| os.system("pip install git+https://github.com/openai/whisper.git") | |
| import gradio as gr | |
| import whisper | |
| #LOAD THE MODEL | |
| model = whisper.load_model("base") | |
| #FUNCTION TO TRANSCRIBE | |
| def speech_to_text(inp): | |
| result = model.transcribe(inp) | |
| return result["text"] | |
| #LAUNCH THE UI WITH GRADIO | |
| demo = gr.Interface(fn=speech_to_text, | |
| inputs=[gr.Audio(type="filepath")], | |
| outputs=["textbox"] | |
| ) | |
| demo.launch(debug=True) |