fionasu commited on
Commit
face5af
·
verified ·
1 Parent(s): 4704d8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -101,6 +101,14 @@ def get_top_chunks(query, chunk_embeddings, text_chunks):
101
  client = InferenceClient("Qwen/Qwen2.5-72B-Instruct")
102
 
103
  def respond(message, history, use_spanish, chatbot_mode, destinations, trip_length, trip_unit, trip_season, 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)
@@ -117,15 +125,15 @@ def respond(message, history, use_spanish, chatbot_mode, destinations, trip_leng
117
 
118
  lang = "Spanish" if use_spanish else "English"
119
  ctx = (
120
- f"Language: {lang}\n"
121
  f"Destination: {', '.join(destinations) if destinations else 'Not specified'}\n"
122
- f"Trip Length: {trip_length} {trip_unit or ''}\n"
123
- f"Trip Season: {trip_season or ''}\n"
124
- f"Luggage: {', '.join(luggage_types) if luggage_types else 'Not specified'}, Size: {luggage_size}L\n"
 
125
  f"Food Preferences: {', '.join(food_prefs) if food_prefs else 'Not specified'}\n"
126
  )
127
 
128
-
129
  chatbot_purpose = f"Chatbot Mode: {chatbot_mode or 'Not specified'}"
130
  print(chatbot_purpose)
131
 
 
101
  client = InferenceClient("Qwen/Qwen2.5-72B-Instruct")
102
 
103
  def respond(message, history, use_spanish, chatbot_mode, destinations, trip_length, trip_unit, trip_season, luggage_types, luggage_size, food_prefs):
104
+ destinations = destinations or []
105
+ trip_length = trip_length or "Not specified"
106
+ trip_unit = trip_unit or ""
107
+ trip_season = trip_season or "Not specified"
108
+ luggage_types = luggage_types or []
109
+ luggage_size = luggage_size or "Not specified"
110
+ food_prefs = food_prefs or []
111
+
112
  top_weather = get_top_chunks(message, chunk_embeddings_weather, cleaned_chunks_weather)
113
  top_luggage = get_top_chunks(message, chunk_embeddings_luggage, cleaned_chunks_luggage)
114
  top_attraction = get_top_chunks(message, chunk_embeddings_attraction, cleaned_chunks_attraction)
 
125
 
126
  lang = "Spanish" if use_spanish else "English"
127
  ctx = (
128
+ f"Language: {'Spanish' if use_spanish else 'English'}\n"
129
  f"Destination: {', '.join(destinations) if destinations else 'Not specified'}\n"
130
+ f"Trip Length: {trip_length} {trip_unit}\n"
131
+ f"Trip Season: {trip_season}\n"
132
+ f"Luggage: {', '.join(luggage_types) if luggage_types else 'Not specified'}, "
133
+ f"Size: {luggage_size}L\n"
134
  f"Food Preferences: {', '.join(food_prefs) if food_prefs else 'Not specified'}\n"
135
  )
136
 
 
137
  chatbot_purpose = f"Chatbot Mode: {chatbot_mode or 'Not specified'}"
138
  print(chatbot_purpose)
139