speechtotext / app.py
MesutUnutur's picture
Create app.py
9b4a831 verified
raw
history blame
481 Bytes
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)