Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
# 加载模型 | |
model = pipeline('automatic-speech-recognition', model='BELLE-2/Belle-whisper-large-v3-zh-punct') | |
def transcribe(audio): | |
result = model(audio) | |
return result['text'] | |
# 创建 Gradio 接口 | |
iface = gr.Interface( | |
fn=transcribe, | |
inputs=gr.inputs.Audio(source="microphone", type="filepath"), | |
outputs="text", | |
live=True | |
) | |
iface.launch() | |