akhaliq HF staff radames commited on
Commit
dd17d3d
1 Parent(s): 48206de

clean components value when switch (#8)

Browse files

- clean components value when switch (db27f1665aae51a21cc7949d0528bf6c62a7d4aa)


Co-authored-by: Radamés Ajna <radames@users.noreply.huggingface.co>

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: