Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| def process_input(address, selected_option, additional_input): | |
| transport_analysis_needed = selected_option in ["Residential", "Office", "Community Facility"] | |
| output_address = f"You entered the address:\n{address}" | |
| output_option = f"Selected option:\n{selected_option}" | |
| if selected_option in ["Off-Street Parking Facility", "Residential"]: | |
| output_additional = f"Number of Units/Spaces:\n{additional_input}" | |
| else: | |
| output_additional = f"Area (in 1000 GSF):\n{additional_input}" | |
| output_transport_analysis = f"Transport Analysis Needed:\n{transport_analysis_needed}" | |
| return output_address, output_option, output_additional, output_transport_analysis | |
| iface = gr.Interface( | |
| fn=process_input, | |
| inputs=[ | |
| gr.inputs.Textbox(label="Enter your address"), | |
| gr.inputs.Radio(["Residential", "Office", "Regional Retail", "Local Retail", "Sit Down/High Turnover Restaurant", "Fast Food/without Drive Through", | |
| "Community Facility", "Off-Street Parking Facility"], label="Select an option"), | |
| gr.inputs.Number(label="Number of Units/Spaces or Area (in 1000 GSF)", default=1) # Default value is 1 | |
| ], | |
| outputs=[ | |
| gr.outputs.Textbox(label="Address"), | |
| gr.outputs.Textbox(label="Selected Option"), | |
| gr.outputs.Textbox(label="Number of Units/Spaces or Area"), | |
| gr.outputs.Textbox(label="Transport Analysis Needed") | |
| ], | |
| ) | |
| iface.launch() | |