File size: 391 Bytes
51267b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()