File size: 540 Bytes
fba32ec
ee79a1c
fba32ec
ee79a1c
fba32ec
cedf6b0
 
 
 
 
 
 
 
ee79a1c
 
8582fe6
ee79a1c
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import gradio as gr
import whisper

model = whisper.load_model("base")

def transcribe(file):
    result = model.transcribe(file)
    text = result['text']
    f = open("transcript_base.txt", "w")
    f.write(text)
    f.close()
    return "transcript_base.txt"

iface = gr.Interface(
    title = 'OpenAI Whisper ASR Gradio Web UI', 
    fn=transcribe, 
    inputs=[
        gr.inputs.Audio(source="upload", type="filepath", label="Upload Audio")
    ],
    outputs=[
        gr.File(label="Download"),
    ],
    live=True)

iface.launch()