Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,15 @@ with gr.Blocks() as demo:
|
|
42 |
|
43 |
radio = gr.Radio(["show", "hide"], label="Choose")
|
44 |
text = gr.Textbox(label="This text only shows when 'show' is selected.", visible=False)
|
|
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
# Define function to update visibility based on dataset choice
|
48 |
def update_visibility():
|
|
|
42 |
|
43 |
radio = gr.Radio(["show", "hide"], label="Choose")
|
44 |
text = gr.Textbox(label="This text only shows when 'show' is selected.", visible=False)
|
45 |
+
|
46 |
|
47 |
+
def update_visibilita(radio): # Accept the event argument, even if not used
|
48 |
+
value = radio # Get the selected value from the radio button
|
49 |
+
if value == "show":
|
50 |
+
return gr.Textbox(visible=bool(1)) #make it visible
|
51 |
+
else:
|
52 |
+
return gr.Textbox(visible=bool(0))]
|
53 |
+
radio.change(update_visibilita, radio, text)
|
54 |
|
55 |
# Define function to update visibility based on dataset choice
|
56 |
def update_visibility():
|