learningai's picture
Update app.py
ac4a6e0
raw
history blame
376 Bytes
import whisper
import config
import gradio as gr
def get_text(audio_path):
model = whisper.load_model(name='base', download_root=config.MODEL_DIR)
results = model.transcribe(audio_path)
return results['text']
label = gr.components.Text()
vd = gr.components.Audio(type="filepath")
iface = gr.Interface(fn=get_text, inputs=vd, outputs=label)
iface.launch()