Commit 1: Add 50 file(s)
Browse files
demos/blocks_essay/run.py
CHANGED
@@ -30,6 +30,7 @@ with gr.Blocks() as demo:
|
|
30 |
with gr.Row():
|
31 |
country = gr.Dropdown(list(countries_cities_dict.keys()), label="Country")
|
32 |
cities = gr.Dropdown([], label="Cities")
|
|
|
33 |
@country.change(inputs=country, outputs=cities)
|
34 |
def update_cities(country):
|
35 |
cities = list(countries_cities_dict[country])
|
@@ -38,7 +39,7 @@ with gr.Blocks() as demo:
|
|
38 |
def reset_bounds(minimum, maximum):
|
39 |
return gr.Number(minimum=minimum, maximum=maximum)
|
40 |
|
41 |
-
radio.change(fn=change_textbox, inputs=radio, outputs=[text, submit_btn], js=True)
|
42 |
gr.on(
|
43 |
[minimum_slider.change, maximum_slider.change],
|
44 |
reset_bounds,
|
|
|
30 |
with gr.Row():
|
31 |
country = gr.Dropdown(list(countries_cities_dict.keys()), label="Country")
|
32 |
cities = gr.Dropdown([], label="Cities")
|
33 |
+
|
34 |
@country.change(inputs=country, outputs=cities)
|
35 |
def update_cities(country):
|
36 |
cities = list(countries_cities_dict[country])
|
|
|
39 |
def reset_bounds(minimum, maximum):
|
40 |
return gr.Number(minimum=minimum, maximum=maximum)
|
41 |
|
42 |
+
radio.change(fn=change_textbox, inputs=radio, outputs=[text, submit_btn], js=True, preprocess=False, postprocess=False)
|
43 |
gr.on(
|
44 |
[minimum_slider.change, maximum_slider.change],
|
45 |
reset_bounds,
|