gamaba commited on
Commit
176207a
·
verified ·
1 Parent(s): ce6d6c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -19
app.py CHANGED
@@ -92,6 +92,25 @@ with gr.Blocks(theme=gr.themes.Soft(), title="AB Elevators") as demo:
92
  </div>
93
  """)
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  with gr.Row():
96
  with gr.Column():
97
  brand = gr.Dropdown(categorical_options['BRAND NAME'], label="🏢 Brand")
@@ -138,25 +157,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="AB Elevators") as demo:
138
  output_price = gr.Markdown()
139
  output_status = gr.Markdown()
140
 
141
- # --- Image Updates ---
142
- lift.change(
143
- fn=lambda x: get_image_path("Lift_Type", x),
144
- inputs=lift,
145
- outputs=lift_img
146
- )
147
-
148
- door_type.change(
149
- fn=lambda x: get_image_path("Door_Type", x),
150
- inputs=door_type,
151
- outputs=door_img
152
- )
153
-
154
- motor.change(
155
- fn=lambda x: get_image_path("Motor_Type", x),
156
- inputs=motor,
157
- outputs=motor_img
158
- )
159
-
160
  predict_btn.click(
161
  fn=predict_price,
162
  inputs=[brand, lift, door_frame, door_type, cabin, motor,
 
92
  </div>
93
  """)
94
 
95
+ # --- Image Updates ---
96
+ lift.change(
97
+ fn=lambda x: get_image_path("Lift_Type", x),
98
+ inputs=lift,
99
+ outputs=lift_img
100
+ )
101
+
102
+ door_type.change(
103
+ fn=lambda x: get_image_path("Door_Type", x),
104
+ inputs=door_type,
105
+ outputs=door_img
106
+ )
107
+
108
+ motor.change(
109
+ fn=lambda x: get_image_path("Motor_Type", x),
110
+ inputs=motor,
111
+ outputs=motor_img
112
+ )
113
+
114
  with gr.Row():
115
  with gr.Column():
116
  brand = gr.Dropdown(categorical_options['BRAND NAME'], label="🏢 Brand")
 
157
  output_price = gr.Markdown()
158
  output_status = gr.Markdown()
159
 
160
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  predict_btn.click(
162
  fn=predict_price,
163
  inputs=[brand, lift, door_frame, door_type, cabin, motor,