Update app.py
Browse files
app.py
CHANGED
@@ -45,21 +45,20 @@ with gr.Blocks() as demo:
|
|
45 |
|
46 |
|
47 |
|
48 |
-
|
|
|
49 |
value = radio.value # Get the selected value from the radio button
|
50 |
-
|
51 |
if value == "Predefined Dataset":
|
52 |
-
|
53 |
-
|
54 |
elif value == "Upload Your Own":
|
55 |
-
|
56 |
-
|
57 |
-
return predef, upload # Return both components
|
58 |
-
|
59 |
-
dataset_predefined, dataset_upload = dataset_choice.change(update_visibility, dataset_choice, dataset_upload)
|
60 |
-
|
61 |
-
|
62 |
|
|
|
|
|
|
|
63 |
|
64 |
# Update visibility based on user choice
|
65 |
#dataset_predefined, dataset_upload = dataset_choice.change(update_dataset_visibility, inputs=[dataset_choice], outputs=[dataset_predefined, dataset_upload])
|
|
|
45 |
|
46 |
|
47 |
|
48 |
+
# Update visibility based on user choice
|
49 |
+
def update_visibility(radio):
|
50 |
value = radio.value # Get the selected value from the radio button
|
51 |
+
|
52 |
if value == "Predefined Dataset":
|
53 |
+
dataset_predefined.visible = True
|
54 |
+
dataset_upload.visible = False
|
55 |
elif value == "Upload Your Own":
|
56 |
+
dataset_predefined.visible = False
|
57 |
+
dataset_upload.visible = True
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
+
# Bind the update_visibility function to the change event of dataset_choice
|
60 |
+
dataset_choice.change(update_visibility)
|
61 |
+
|
62 |
|
63 |
# Update visibility based on user choice
|
64 |
#dataset_predefined, dataset_upload = dataset_choice.change(update_dataset_visibility, inputs=[dataset_choice], outputs=[dataset_predefined, dataset_upload])
|