harishB97 commited on
Commit
ff419db
·
verified ·
1 Parent(s): e8af752

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -158,7 +158,7 @@ def update_options(selected_option):
158
  new_options = ["Suboption 3.1", "Suboption 3.2"]
159
 
160
  # Return the new options to update the second dropdown
161
- return new_options, selected_option # Return current selection to persist it in the first dropdown
162
 
163
  with gr.Blocks() as demo:
164
  with gr.Row():
@@ -166,6 +166,6 @@ with gr.Blocks() as demo:
166
  dropdown_2 = gr.Dropdown([], label="Sub Options")
167
 
168
  # When the first dropdown changes, update the options in the second dropdown
169
- dropdown_1.change(fn=update_options, inputs=dropdown_1, outputs=[dropdown_2, dropdown_1])
170
 
171
  demo.launch()
 
158
  new_options = ["Suboption 3.1", "Suboption 3.2"]
159
 
160
  # Return the new options to update the second dropdown
161
+ return new_options # Return current selection to persist it in the first dropdown
162
 
163
  with gr.Blocks() as demo:
164
  with gr.Row():
 
166
  dropdown_2 = gr.Dropdown([], label="Sub Options")
167
 
168
  # When the first dropdown changes, update the options in the second dropdown
169
+ dropdown_1.change(fn=update_options, inputs=dropdown_1, outputs=dropdown_2)
170
 
171
  demo.launch()