Spaces:
Sleeping
Sleeping
import gradio as gr | |
from PIL import Image | |
STORE_MAP_FILE = "assets/store_map_clinicplus.png" | |
def reset_all(): | |
return ( | |
None, None, None, None, None, None, None, | |
gr.update(choices=[], visible=False), | |
"", {}, Image.open(STORE_MAP_FILE) | |
) | |
with gr.Blocks() as demo: | |
country = gr.Dropdown(choices=["A"], value="A") | |
state = gr.Dropdown(choices=["B"], value="B") | |
city = gr.Dropdown(choices=["C"], value="C") | |
store = gr.Dropdown(choices=["D"], value="D") | |
category = gr.Dropdown(choices=["E"], value="E") | |
product = gr.Dropdown(choices=["F"], value="F") | |
brand = gr.Dropdown(choices=["G"], value="G") | |
quantity = gr.Dropdown(choices=["1"], value="1", visible=True) | |
result = gr.Textbox("", lines=2) | |
data_state = gr.State(value={"x": 1}) | |
store_map = gr.Image(value=Image.open(STORE_MAP_FILE), type="pil") | |
reset_btn = gr.Button("Reset") | |
reset_btn.click( | |
reset_all, | |
inputs=[], | |
outputs=[country, state, city, store, category, product, brand, quantity, result, data_state, store_map] | |
) | |
demo.launch() | |