Spaces:
Runtime error
Runtime error
File size: 1,261 Bytes
6bd4abf 4edbe8b 7542d4a 621197c 7542d4a 621197c 7542d4a 4edbe8b 8a21b24 0fbe956 4edbe8b 0fbe956 4edbe8b 8a21b24 4edbe8b 57af65a 4edbe8b 0fbe956 6bd4abf 57af65a 7542d4a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import gradio as gr
def process_input(address, selected_option, additional_input):
transport_analysis_needed = selected_option in ["Residential", "Office", "Community Facility"]
if selected_option in ["Off-Street Parking Facility", "Residential"]:
output_text = f"You entered the address:\n{address}\n\nSelected option:\n{selected_option}\n\nNumber of Units/Spaces:\n{additional_input}\n\nTransport Analysis Needed:\n{transport_analysis_needed}"
else:
output_text = f"You entered the address:\n{address}\n\nSelected option:\n{selected_option}\n\nArea (in 1000 GSF):\n{additional_input}\n\nTransport Analysis Needed:\n{transport_analysis_needed}"
return output_text
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="Output"),
)
iface.launch()
|