fionasu commited on
Commit
60f04cb
·
verified ·
1 Parent(s): 3a375f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -100,7 +100,7 @@ def get_top_chunks(query, chunk_embeddings, text_chunks):
100
 
101
  client = InferenceClient("Qwen/Qwen2.5-72B-Instruct")
102
 
103
- def respond(message, history, use_spanish, chatbot_mode, destinations, departure_date, return_date, luggage_types, luggage_size, food_prefs):
104
  top_weather = get_top_chunks(message, chunk_embeddings_weather, cleaned_chunks_weather)
105
  top_luggage = get_top_chunks(message, chunk_embeddings_luggage, cleaned_chunks_luggage)
106
  top_attraction = get_top_chunks(message, chunk_embeddings_attraction, cleaned_chunks_attraction)
@@ -119,7 +119,7 @@ def respond(message, history, use_spanish, chatbot_mode, destinations, departure
119
  ctx = (
120
  f"Language: {lang}\n"
121
  f"Destination: {', '.join(destinations)}\n"
122
- f"Travel Dates: From {departure_date} to {return_date}\n"
123
  f"Luggage: {', '.join(luggage_types)} of size {luggage_size}\n"
124
  f"Food: {', '.join(food_prefs)}\n"
125
  )
@@ -174,9 +174,13 @@ with gr.Blocks() as demo:
174
  choices=["San Francisco","Los Angeles"],
175
  label="Where are you going?"
176
  )
177
- gr.Markdown("### Travel Dates")
178
- departure_date = gr.Textbox(label="Departure Date", type="date")
179
- return_date = gr.Textbox(label="Return Date", type="date")
 
 
 
 
180
 
181
  gr.Markdown("### Luggage")
182
  luggage_types = gr.CheckboxGroup(
@@ -218,8 +222,8 @@ with gr.Blocks() as demo:
218
  use_spanish,
219
  chatbot_mode,
220
  destinations,
221
- departure_date,
222
- return_date,
223
  luggage_types,
224
  luggage_size,
225
  food_prefs
 
100
 
101
  client = InferenceClient("Qwen/Qwen2.5-72B-Instruct")
102
 
103
+ def respond(message, history, use_spanish, chatbot_mode, destinations, trip_length, trip_unit, luggage_types, luggage_size, food_prefs):
104
  top_weather = get_top_chunks(message, chunk_embeddings_weather, cleaned_chunks_weather)
105
  top_luggage = get_top_chunks(message, chunk_embeddings_luggage, cleaned_chunks_luggage)
106
  top_attraction = get_top_chunks(message, chunk_embeddings_attraction, cleaned_chunks_attraction)
 
119
  ctx = (
120
  f"Language: {lang}\n"
121
  f"Destination: {', '.join(destinations)}\n"
122
+ f"Trip Length: {trip_length} {trip_unit}\n"
123
  f"Luggage: {', '.join(luggage_types)} of size {luggage_size}\n"
124
  f"Food: {', '.join(food_prefs)}\n"
125
  )
 
174
  choices=["San Francisco","Los Angeles"],
175
  label="Where are you going?"
176
  )
177
+ gr.Markdown("### Trip Duration")
178
+ trip_length = gr.Number(label="How long is your trip?", precision=0)
179
+ trip_unit = gr.Radio(
180
+ choices=["days", "weeks", "months"],
181
+ label="Trip length unit"
182
+ )
183
+
184
 
185
  gr.Markdown("### Luggage")
186
  luggage_types = gr.CheckboxGroup(
 
222
  use_spanish,
223
  chatbot_mode,
224
  destinations,
225
+ trip_length,
226
+ trip_unit,
227
  luggage_types,
228
  luggage_size,
229
  food_prefs