zhaochaojin commited on
Commit ·
0418fbe
1
Parent(s): 6867461
fix: ASR
Browse files1234345667891011121314import gradio as gr
def greet(name): return "Hello " + name + "!!"def speech_to_text(audio): # 这里暂时返回固定文本,后续可接入语音识别模型 return "这是语音转文本的结果。"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")demo = gr.Interface( fn=speech_to_text, inputs=gr.Audio(source="microphone", type="filepath"), outputs="text", title="语音转文本演示", description="请录制一段语音,系统将返回转写文本(目前为默认文本)。")demo.launch()app.py+10-3