ljrmary commited on
Commit
621197c
1 Parent(s): 8a21b24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -1,18 +1,22 @@
1
  import gradio as gr
2
 
3
- def process_input(input_text, selected_option):
4
- # Your processing logic here based on the input_text and selected_option
5
- # For this example, let's just return the input_text as the output.
6
- return input_text
 
 
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
+