Spaces:
Runtime error
Runtime error
jasper9w
commited on
Commit
·
92e7451
1
Parent(s):
bd6160e
更新录音方式
Browse files
app.py
CHANGED
@@ -8,6 +8,15 @@ def asr(test_file):
|
|
8 |
return pipe(test_file, max_new_tokens=100)
|
9 |
|
10 |
def gradio_asr(test_file):
|
11 |
-
return asr(test_file
|
12 |
|
13 |
-
gr.Interface(fn=gradio_asr,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
return pipe(test_file, max_new_tokens=100)
|
9 |
|
10 |
def gradio_asr(test_file):
|
11 |
+
return asr(test_file)
|
12 |
|
13 |
+
asr_upload = gr.Interface(fn=gradio_asr,
|
14 |
+
inputs=gr.Audio(source='upload', type='filepath'),
|
15 |
+
outputs='text')
|
16 |
+
|
17 |
+
app_mic = gr.Interface(fn=gradio_asr,
|
18 |
+
inputs=gr.Audio(source='microphone', type='filepath'),
|
19 |
+
outputs='text')
|
20 |
+
|
21 |
+
app = gr.TabbedInterface([asr_upload, app_mic], ["语音文件", "实时识别"])
|
22 |
+
app.launch(server_name='0.0.0.0', ssl_verify=False, share=True)
|