Update app.py
Browse files
app.py
CHANGED
@@ -25,8 +25,19 @@ def update_dropdown_value(query, key_up_data: gr.KeyUpData):
|
|
25 |
|
26 |
with gr.Blocks() as demo:
|
27 |
with gr.Row():
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
dataset_dropdown.key_up(fn=update_dropdown, inputs=dataset_dropdown, outputs=dataset_dropdown, queue=False, show_progress="hidden")
|
31 |
dataset_dropdown_update.key_up(fn=update_dropdown_value, inputs=dataset_dropdown, outputs=dataset_dropdown, queue=False, show_progress="hidden")
|
32 |
demo.launch()
|
|
|
25 |
|
26 |
with gr.Blocks() as demo:
|
27 |
with gr.Row():
|
28 |
+
with gr.Column():
|
29 |
+
gr.Markdown('''Return is:
|
30 |
+
```
|
31 |
+
gr.update(choices=datasets, visible=True)
|
32 |
+
```''')
|
33 |
+
|
34 |
+
dataset_dropdown = gr.Dropdown(label="Datasets", info="Don't update value", choices=[""], elem_id="dataset_list", interactive=True, filterable=True, allow_custom_value=True)
|
35 |
+
with gr.Column():
|
36 |
+
gr.Markdown('''Return is:
|
37 |
+
```
|
38 |
+
gr.update(choices=datasets, value=key_up_data.input_value, visible=True)
|
39 |
+
```''')
|
40 |
+
dataset_dropdown_update = gr.Dropdown(label="Datasets", info="Update value", choices=[""], elem_id="dataset_list", interactive=True, filterable=True, allow_custom_value=True)
|
41 |
dataset_dropdown.key_up(fn=update_dropdown, inputs=dataset_dropdown, outputs=dataset_dropdown, queue=False, show_progress="hidden")
|
42 |
dataset_dropdown_update.key_up(fn=update_dropdown_value, inputs=dataset_dropdown, outputs=dataset_dropdown, queue=False, show_progress="hidden")
|
43 |
demo.launch()
|