Update app.py
Browse files
app.py
CHANGED
@@ -44,18 +44,17 @@ with gr.Blocks() as demo:
|
|
44 |
text = gr.Textbox(label="This text only shows when 'show' is selected.", visible=False)
|
45 |
|
46 |
|
47 |
-
#
|
48 |
-
def update_visibility(
|
49 |
-
|
50 |
-
|
51 |
-
if value == "Predefined Dataset":
|
52 |
dataset_predefined.visible = True
|
53 |
dataset_upload.visible = False
|
54 |
-
elif
|
55 |
dataset_predefined.visible = False
|
56 |
dataset_upload.visible = True
|
57 |
-
|
58 |
-
# Bind
|
59 |
dataset_choice.change(update_visibility)
|
60 |
|
61 |
# Update visibility based on user choice
|
|
|
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():
|
49 |
+
choice = dataset_choice.value
|
50 |
+
if choice == "Predefined Dataset":
|
|
|
51 |
dataset_predefined.visible = True
|
52 |
dataset_upload.visible = False
|
53 |
+
elif choice == "Upload Your Own":
|
54 |
dataset_predefined.visible = False
|
55 |
dataset_upload.visible = True
|
56 |
+
|
57 |
+
# Bind visibility update function to change event of dataset_choice
|
58 |
dataset_choice.change(update_visibility)
|
59 |
|
60 |
# Update visibility based on user choice
|