Spaces:
Runtime error
Runtime error
Update app.py
#2
by
sriyachalla
- opened
app.py
CHANGED
|
@@ -3,11 +3,17 @@ import gradio as gr
|
|
| 3 |
def process_input(address, selected_option, additional_input):
|
| 4 |
transport_analysis_needed = selected_option in ["Residential", "Office", "Community Facility"]
|
| 5 |
|
|
|
|
|
|
|
|
|
|
| 6 |
if selected_option in ["Off-Street Parking Facility", "Residential"]:
|
| 7 |
-
|
| 8 |
else:
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
iface = gr.Interface(
|
| 13 |
fn=process_input,
|
|
@@ -17,8 +23,14 @@ iface = gr.Interface(
|
|
| 17 |
"Community Facility", "Off-Street Parking Facility"], label="Select an option"),
|
| 18 |
gr.inputs.Number(label="Number of Units/Spaces or Area (in 1000 GSF)", default=1) # Default value is 1
|
| 19 |
],
|
| 20 |
-
outputs=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
)
|
| 22 |
|
| 23 |
iface.launch()
|
| 24 |
|
|
|
|
|
|
| 3 |
def process_input(address, selected_option, additional_input):
|
| 4 |
transport_analysis_needed = selected_option in ["Residential", "Office", "Community Facility"]
|
| 5 |
|
| 6 |
+
output_address = f"You entered the address:\n{address}"
|
| 7 |
+
output_option = f"Selected option:\n{selected_option}"
|
| 8 |
+
|
| 9 |
if selected_option in ["Off-Street Parking Facility", "Residential"]:
|
| 10 |
+
output_additional = f"Number of Units/Spaces:\n{additional_input}"
|
| 11 |
else:
|
| 12 |
+
output_additional = f"Area (in 1000 GSF):\n{additional_input}"
|
| 13 |
+
|
| 14 |
+
output_transport_analysis = f"Transport Analysis Needed:\n{transport_analysis_needed}"
|
| 15 |
+
|
| 16 |
+
return output_address, output_option, output_additional, output_transport_analysis
|
| 17 |
|
| 18 |
iface = gr.Interface(
|
| 19 |
fn=process_input,
|
|
|
|
| 23 |
"Community Facility", "Off-Street Parking Facility"], label="Select an option"),
|
| 24 |
gr.inputs.Number(label="Number of Units/Spaces or Area (in 1000 GSF)", default=1) # Default value is 1
|
| 25 |
],
|
| 26 |
+
outputs=[
|
| 27 |
+
gr.outputs.Textbox(label="Address"),
|
| 28 |
+
gr.outputs.Textbox(label="Selected Option"),
|
| 29 |
+
gr.outputs.Textbox(label="Number of Units/Spaces or Area"),
|
| 30 |
+
gr.outputs.Textbox(label="Transport Analysis Needed")
|
| 31 |
+
],
|
| 32 |
)
|
| 33 |
|
| 34 |
iface.launch()
|
| 35 |
|
| 36 |
+
|