fbadine commited on
Commit
1c6d9a8
1 Parent(s): bae5bb1

Update app.py

Browse files

Updating Gradio code to be compatible with the latest version

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")
@@ -175,11 +172,11 @@ if __name__ == "__main__":
175
  clr_btn.click(
176
  fn=clear_inputs_and_outputs,
177
  inputs=[],
178
- outputs=[mic_input, upl_input, lbl_output, plt_output],
179
  )
180
  prd_btn.click(
181
  fn=predict_accent,
182
- inputs=[mic_input, upl_input],
183
  outputs=[lbl_output, plt_output],
184
  )
185
 
 
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")
 
172
  clr_btn.click(
173
  fn=clear_inputs_and_outputs,
174
  inputs=[],
175
+ outputs=[src_input, lbl_output, plt_output],
176
  )
177
  prd_btn.click(
178
  fn=predict_accent,
179
+ inputs=[src_input],
180
  outputs=[lbl_output, plt_output],
181
  )
182