fionasu commited on
Commit
a9a5087
Β·
verified Β·
1 Parent(s): 6710316

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -2
app.py CHANGED
@@ -195,8 +195,20 @@ def respond(message, history, language, chatbot_mode, destinations, trip_length,
195
  history.append((message, reply))
196
  return history, ""
197
 
198
- #return response['choices'][0]['message']['content'].strip()
199
-
 
 
 
 
 
 
 
 
 
 
 
 
200
  with gr.Blocks() as demo:
201
  with gr.Row():
202
  # ─── left column: your controls ───
@@ -249,6 +261,26 @@ with gr.Blocks() as demo:
249
  multiselect=True
250
  )
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  with gr.Column(scale=3):
253
  gr.Image(value="Go Buddy2.png", interactive=False, show_label=False)
254
 
@@ -303,4 +335,6 @@ with gr.Blocks() as demo:
303
  outputs=[chat_box, msg]
304
  )
305
 
 
 
306
  demo.launch(debug=True)
 
195
  history.append((message, reply))
196
  return history, ""
197
 
198
+ def reset_inputs():
199
+ return (
200
+ None, # language
201
+ None, # chatbot_mode
202
+ [], # destinations
203
+ None, # trip_length
204
+ None, # trip_unit
205
+ None, # trip_season
206
+ [], # luggage_types
207
+ 20, # luggage_size (default)
208
+ [], # food_prefs
209
+ [] # activity
210
+ )
211
+
212
  with gr.Blocks() as demo:
213
  with gr.Row():
214
  # ─── left column: your controls ───
 
261
  multiselect=True
262
  )
263
 
264
+ reset_btn = gr.Button("Reset All", variant="secondary")
265
+ reset_btn.click(
266
+ fn=reset_inputs,
267
+ inputs=[],
268
+ outputs=[
269
+ language,
270
+ chatbot_mode,
271
+ destinations,
272
+ trip_length,
273
+ trip_unit,
274
+ trip_season,
275
+ luggage_types,
276
+ luggage_size,
277
+ food_prefs,
278
+ activity
279
+ ]
280
+ )
281
+
282
+
283
+
284
  with gr.Column(scale=3):
285
  gr.Image(value="Go Buddy2.png", interactive=False, show_label=False)
286
 
 
335
  outputs=[chat_box, msg]
336
  )
337
 
338
+
339
+
340
  demo.launch(debug=True)