audio_to_text / app.py
kabita-choudhary's picture
Update app.py
146c764
raw
history blame contribute delete
402 Bytes
import gradio as gr
import whisper
def translatetotext(audio):
model = whisper.load_model("base")
audio = whisper.load_audio(audio)
result1= model.transcribe(audio)
#print (result1["text"])
return result1["text"]
demo = gr.Interface(
fn=translatetotext,
inputs=gr.Audio(source="upload",type="filepath"),
examples=[["Example.mp3"]],
outputs="text"
)
demo.launch()