radames commited on
Commit
db27f16
1 Parent(s): 48206de

clean components value when switch

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -34,9 +34,9 @@ examples = [['test.wav', "This is real time voice cloning on huggingface spaces"
34
 
35
  def toggle(choice):
36
  if choice == "mic":
37
- return gr.update(visible=True), gr.update(visible=False)
38
  else:
39
- return gr.update(visible=False), gr.update(visible=True)
40
 
41
 
42
  with gr.Blocks() as demo:
 
34
 
35
  def toggle(choice):
36
  if choice == "mic":
37
+ return gr.update(visible=True, value=None), gr.update(visible=False, value=None)
38
  else:
39
+ return gr.update(visible=False, value=None), gr.update(visible=True, value=None)
40
 
41
 
42
  with gr.Blocks() as demo: