Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,22 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def process_input(
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
7 |
|
8 |
iface = gr.Interface(
|
9 |
fn=process_input,
|
10 |
inputs=[
|
11 |
-
gr.inputs.Textbox(),
|
12 |
gr.inputs.Radio(["Residential", "Office", "Regional Retail", "Local Retail", "Sit Down/High Turnover Restaurant", "Fast Food/without Drive Through",
|
13 |
-
"Community Facility", "Off-Street Parking Facility"])
|
|
|
14 |
],
|
15 |
-
outputs=gr.outputs.Textbox(),
|
16 |
)
|
17 |
|
18 |
iface.launch()
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
def process_input(address, selected_option, additional_input):
|
4 |
+
if selected_option in ["Off-Street Parking Facility", "Residential"]:
|
5 |
+
output_text = f"You entered the address: {address}. Selected option: {selected_option}. Number of Units/Spaces: {additional_input}."
|
6 |
+
else:
|
7 |
+
output_text = f"You entered the address: {address}. Selected option: {selected_option}. Area (in 1000 GSF): {additional_input}."
|
8 |
+
return output_text
|
9 |
|
10 |
iface = gr.Interface(
|
11 |
fn=process_input,
|
12 |
inputs=[
|
13 |
+
gr.inputs.Textbox(label="Enter your address"),
|
14 |
gr.inputs.Radio(["Residential", "Office", "Regional Retail", "Local Retail", "Sit Down/High Turnover Restaurant", "Fast Food/without Drive Through",
|
15 |
+
"Community Facility", "Off-Street Parking Facility"], label="Select an option"),
|
16 |
+
gr.inputs.Number(label="Number of Units/Spaces or Area (in 1000 GSF)", default=1) # Default value is 1
|
17 |
],
|
18 |
+
outputs=gr.outputs.Textbox(label="Output"),
|
19 |
)
|
20 |
|
21 |
iface.launch()
|
22 |
+
|