fbadine commited on
Commit
4742896
1 Parent(s): 86b583c

Update app.py

Browse files

Updated app.py code in order to be compliant with Gradio 4.44

Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -155,10 +155,7 @@ if __name__ == "__main__":
155
  with gr.Row():
156
  ## Input
157
  with gr.Column():
158
- mic_input = gr.Audio(source="microphone", label="Record your own voice")
159
- upl_input = gr.Audio(
160
- source="upload", type="filepath", label="Upload a wav file"
161
- )
162
 
163
  with gr.Row():
164
  clr_btn = gr.Button(value="Clear", variant="secondary")
@@ -187,11 +184,11 @@ if __name__ == "__main__":
187
  clr_btn.click(
188
  fn=clear_inputs_and_outputs,
189
  inputs=[],
190
- outputs=[mic_input, upl_input, lbl_output, plt_output],
191
  )
192
  prd_btn.click(
193
  fn=predict_accent,
194
- inputs=[mic_input, upl_input],
195
  outputs=[lbl_output, plt_output],
196
  )
197
 
 
155
  with gr.Row():
156
  ## Input
157
  with gr.Column():
158
+ src_input = gr.Audio(sources=["microphone", "upload"])
 
 
 
159
 
160
  with gr.Row():
161
  clr_btn = gr.Button(value="Clear", variant="secondary")
 
184
  clr_btn.click(
185
  fn=clear_inputs_and_outputs,
186
  inputs=[],
187
+ outputs=[src_input, lbl_output, plt_output],
188
  )
189
  prd_btn.click(
190
  fn=predict_accent,
191
+ inputs=[src_input],
192
  outputs=[lbl_output, plt_output],
193
  )
194