DeepLearning101 commited on
Commit
e8353f3
·
verified ·
1 Parent(s): 5d0b0e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -86,7 +86,15 @@ def transcribe(file_upload, microphone):
86
  enhanced.export('enhanced_final.mp3', format="mp3", bitrate="256k")
87
 
88
  return "enhanced_final.mp3" # 回傳 MP3 更省空間
89
-
 
 
 
 
 
 
 
 
90
  demo = gr.Interface(
91
  fn=transcribe,
92
  inputs=[
@@ -111,10 +119,10 @@ demo = gr.Interface(
111
  <a href='https://blog.twman.org/2023/07/HugIE.html' target='_blank'>基於機器閱讀理解和指令微調的統一信息抽取框架之診斷書醫囑資訊擷取分析</a><br>
112
  <a href='https://github.com/facebookresearch/denoiser' target='_blank'> Real Time Speech Enhancement in the Waveform Domain (Interspeech 2020)</a>""",
113
  allow_flagging="never",
114
- examples=[
115
- ["exampleAudio/15s_2020-03-27_sep1.wav"],
116
- ["exampleAudio/13s_2020-03-27_sep2.wav"],
117
- ],
118
  )
119
 
120
  demo.launch(debug=True, share=True)
 
86
  enhanced.export('enhanced_final.mp3', format="mp3", bitrate="256k")
87
 
88
  return "enhanced_final.mp3" # 回傳 MP3 更省空間
89
+
90
+
91
+ # 👇 加上這一行,解決 Gradio schema 推導錯誤
92
+ transcribe.__annotations__ = {
93
+ "file_upload": str,
94
+ "microphone": str,
95
+ "return": str
96
+ }
97
+
98
  demo = gr.Interface(
99
  fn=transcribe,
100
  inputs=[
 
119
  <a href='https://blog.twman.org/2023/07/HugIE.html' target='_blank'>基於機器閱讀理解和指令微調的統一信息抽取框架之診斷書醫囑資訊擷取分析</a><br>
120
  <a href='https://github.com/facebookresearch/denoiser' target='_blank'> Real Time Speech Enhancement in the Waveform Domain (Interspeech 2020)</a>""",
121
  allow_flagging="never",
122
+ # examples=[
123
+ # ["exampleAudio/15s_2020-03-27_sep1.wav"],
124
+ # ["exampleAudio/13s_2020-03-27_sep2.wav"],
125
+ # ],
126
  )
127
 
128
  demo.launch(debug=True, share=True)