tykiww commited on
Commit
94c21e2
·
verified ·
1 Parent(s): 4c8a1d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
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
- # Update visibility based on user choice
48
- def update_visibility(event=None):
49
- value = dataset_choice.value # Get the selected value from the radio button
50
-
51
- if value == "Predefined Dataset":
52
  dataset_predefined.visible = True
53
  dataset_upload.visible = False
54
- elif value == "Upload Your Own":
55
  dataset_predefined.visible = False
56
  dataset_upload.visible = True
57
-
58
- # Bind the update_visibility function to the change event of dataset_choice
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