area444 commited on
Commit
c1fb0a2
verified
1 Parent(s): d0997e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -24,7 +24,7 @@ def hide_and_show_panel():
24
  with gr.Blocks() as demo:
25
 
26
  # Create the first panel (visible from the start)
27
- with gr.Column() as panel_1:
28
  # Textbox where the first word is entered
29
  user_text = gr.Textbox(label="Escribe 'user' para continuar")
30
 
@@ -33,8 +33,6 @@ with gr.Blocks() as demo:
33
 
34
  # First button, visible from the start
35
  btn_1 = gr.Button("Bot贸n 1 (Siempre visible)")
36
- # Configure the buttons and the panel visibility
37
- btn_1.click(check_words, inputs=[user_text, input_text], outputs=[panel_2, panel_1]) # Hide Panel 1 and show Panel 2
38
 
39
  # Create the second panel that is initially hidden
40
  with gr.Column(visible=False) as panel_2:
@@ -44,7 +42,8 @@ with gr.Blocks() as demo:
44
  btn_2 = gr.Button("Ocultar el Panel", visible=True)
45
  btn_2.click(hide_and_show_panel, outputs=[panel_2, panel_1]) # Hide Panel 2 and show Panel 1
46
 
47
-
 
48
 
49
  # Launch the Gradio interface
50
  demo.launch()
 
24
  with gr.Blocks() as demo:
25
 
26
  # Create the first panel (visible from the start)
27
+ with gr.Column(visible=True) as panel_1:
28
  # Textbox where the first word is entered
29
  user_text = gr.Textbox(label="Escribe 'user' para continuar")
30
 
 
33
 
34
  # First button, visible from the start
35
  btn_1 = gr.Button("Bot贸n 1 (Siempre visible)")
 
 
36
 
37
  # Create the second panel that is initially hidden
38
  with gr.Column(visible=False) as panel_2:
 
42
  btn_2 = gr.Button("Ocultar el Panel", visible=True)
43
  btn_2.click(hide_and_show_panel, outputs=[panel_2, panel_1]) # Hide Panel 2 and show Panel 1
44
 
45
+ # Configure the buttons and the panel visibility
46
+ btn_1.click(check_words, inputs=[user_text, input_text], outputs=[panel_2, panel_1]) # Hide Panel 1 and show Panel 2
47
 
48
  # Launch the Gradio interface
49
  demo.launch()