File size: 438 Bytes
d03259c
 
 
 
ddbafad
d03259c
 
 
 
 
92e7451
d03259c
92e7451
384f3d6
92e7451
 
384f3d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from transformers import pipeline
import gradio as gr
import numpy as np

pipe = pipeline(model="mg5812/whisper-tiny-zh5")

def asr(test_file):        
    return pipe(test_file, max_new_tokens=100) 

def gradio_asr(test_file):
    return asr(test_file)

app_mic = gr.Interface(fn=gradio_asr,
                   inputs=gr.Audio(type='filepath'),
                   outputs='text')

app_mic.launch(server_name='0.0.0.0', ssl_verify=False)