learningai's picture
first commit
51267b6
raw
history blame
391 Bytes
import whisper
import config
import gradio as gr
def get_text(audio_path):
print(aud)
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()