Spaces:
Sleeping
Sleeping
File size: 481 Bytes
9b4a831 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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) |