UT_Hackathon / app.py
sriyachalla's picture
Update app.py
d44b9d3
raw
history blame
1.26 kB
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()