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