Whisper_Audio / app.py
GundeRichardson's picture
Create app.py
b9a9cf4 verified
raw
history blame
480 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)