Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -40,26 +40,25 @@ with gr.Blocks() as demo:
|
|
40 |
|
41 |
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
taxt = gr.Textbox(label="This text only shows when 'hide' is selected.", visible=True)
|
46 |
|
47 |
-
def
|
48 |
value = radio # Get the selected value from the radio button
|
49 |
-
if value == "
|
50 |
-
return gr.
|
51 |
else:
|
52 |
-
return gr.
|
53 |
|
54 |
-
def
|
55 |
value = radio
|
56 |
-
if value == "
|
57 |
-
return gr.
|
58 |
else:
|
59 |
-
return gr.
|
60 |
|
61 |
-
radio.change(
|
62 |
-
radio.change(
|
63 |
|
64 |
# Define function to update visibility based on dataset choice
|
65 |
def update_visibility():
|
|
|
40 |
|
41 |
|
42 |
|
43 |
+
|
44 |
+
|
|
|
45 |
|
46 |
+
def dropdown_visibility(radio): # Accept the event argument, even if not used
|
47 |
value = radio # Get the selected value from the radio button
|
48 |
+
if value == "Predefined Dataset":
|
49 |
+
return gr.Dropdown(visible=bool(1))
|
50 |
else:
|
51 |
+
return gr.Dropdown(visible=bool(0))
|
52 |
|
53 |
+
def upload_visibility(radio):
|
54 |
value = radio
|
55 |
+
if value == "Upload Your Own":
|
56 |
+
return gr.UploadButton(visible=bool(1)) #make it visible
|
57 |
else:
|
58 |
+
return gr.UploadButton(visible=bool(0))
|
59 |
|
60 |
+
radio.change(dropdown_visibility, dataset_choice, dataset_predefined)
|
61 |
+
radio.change(upload_visibility, dataset_choice, dataset_upload)
|
62 |
|
63 |
# Define function to update visibility based on dataset choice
|
64 |
def update_visibility():
|