whisper-tuning / app.py
weilikai01
modify app.py, set type=filepath
384f3d6
raw
history blame contribute delete
438 Bytes
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)