Update app.py
Browse files
app.py
CHANGED
@@ -26,18 +26,18 @@ def update_dropdown_value(query, key_up_data: gr.KeyUpData):
|
|
26 |
with gr.Blocks() as demo:
|
27 |
with gr.Row():
|
28 |
with gr.Column():
|
29 |
-
gr.
|
|
|
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.
|
|
|
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()
|
|
|
26 |
with gr.Blocks() as demo:
|
27 |
with gr.Row():
|
28 |
with gr.Column():
|
29 |
+
dataset_dropdown = gr.Dropdown(label="Datasets", info="Don't update value", choices=[""], elem_id="dataset_list", interactive=True, filterable=True, allow_custom_value=True)
|
30 |
+
gr.Markdown('''Here the return is:
|
31 |
```
|
32 |
gr.update(choices=datasets, visible=True)
|
33 |
+
```
|
34 |
+
''')
|
|
|
35 |
with gr.Column():
|
36 |
+
dataset_dropdown_update = gr.Dropdown(label="Datasets", info="Update value", choices=[""], elem_id="dataset_list", interactive=True, filterable=True, allow_custom_value=True)
|
37 |
+
gr.Markdown('''Here the return is:
|
38 |
```
|
39 |
gr.update(choices=datasets, value=key_up_data.input_value, visible=True)
|
40 |
```''')
|
|
|
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()
|