harishB97 commited on
Commit
6d5e96c
·
verified ·
1 Parent(s): 96ada74

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -16
app.py CHANGED
@@ -1,3 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # import gradio as gr
2
  # import plotly.graph_objects as go
3
  # import os
@@ -185,21 +203,5 @@
185
 
186
  # demo.launch()
187
 
188
- import gradio as gr
189
- import time
190
 
191
- def update_options(selected_option):
192
- new_options = [selected_option, 'Something', 'something else']
193
- return new_options # Return current selection to persist it in the first dropdown
194
-
195
- with gr.Blocks() as interface:
196
- dropdown = gr.Dropdown(choices=["Anna", "Christine", "Phoebe"])
197
- dropdown2 = gr.Dropdown(choices=["Anna", "Christine", "Phoebe"])
198
- btn = gr.Button("Trigger!")
199
-
200
- btn.click(lambda: "Phoebe", None, dropdown)
201
- # dropdown.change(update_options, dropdown, dropdown2)
202
- dropdown.change(lambda x: x, dropdown, dropdown2)
203
-
204
- interface.launch()
205
 
 
1
+ import gradio as gr
2
+ import time
3
+
4
+ def update_options(selected_option):
5
+ # new_options = [selected_option, 'Something', 'something else']
6
+ return selected_option # Return current selection to persist it in the first dropdown
7
+
8
+ with gr.Blocks() as interface:
9
+ dropdown = gr.Dropdown(choices=["Anna", "Christine", "Phoebe"])
10
+ dropdown2 = gr.Dropdown(choices=["Anna", "Christine", "Phoebe"])
11
+ btn = gr.Button("Trigger!")
12
+
13
+ btn.click(lambda: "Phoebe", None, dropdown)
14
+ dropdown.change(update_options, dropdown, dropdown2)
15
+ # dropdown.change(lambda x: x, dropdown, dropdown2)
16
+
17
+ interface.launch()
18
+
19
  # import gradio as gr
20
  # import plotly.graph_objects as go
21
  # import os
 
203
 
204
  # demo.launch()
205
 
 
 
206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207