Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -85,9 +85,9 @@ def generate_itinerary(mood, location, budget, days):
|
|
| 85 |
f"The mood of the traveler is {mood_text} and the budget is {budget_text}. "
|
| 86 |
f"Use Markdown formatting with **bold headings** for days and time slots."
|
| 87 |
)
|
| 88 |
-
|
| 89 |
completion = client.chat.completions.create(
|
| 90 |
-
model="
|
| 91 |
messages=[
|
| 92 |
{"role": "system", "content": "You are an expert travel planner."},
|
| 93 |
{"role": "user", "content": prompt}
|
|
@@ -99,12 +99,11 @@ def generate_itinerary(mood, location, budget, days):
|
|
| 99 |
)
|
| 100 |
|
| 101 |
itinerary_text = completion.choices[0].message.content
|
| 102 |
-
season_text = get_best_season(location_text)
|
| 103 |
image_path = os.path.abspath(MOOD_IMAGES.get(mood, MOOD_IMAGES["Any"]))
|
|
|
|
| 104 |
map_html = extract_places_and_map(itinerary_text, city_context=location_text if location_text.lower() != "any destination" else None)
|
| 105 |
|
| 106 |
-
|
| 107 |
-
return combined_output, image_path, map_html
|
| 108 |
|
| 109 |
def generate_pdf(itinerary_text):
|
| 110 |
if not itinerary_text.strip():
|
|
|
|
| 85 |
f"The mood of the traveler is {mood_text} and the budget is {budget_text}. "
|
| 86 |
f"Use Markdown formatting with **bold headings** for days and time slots."
|
| 87 |
)
|
| 88 |
+
|
| 89 |
completion = client.chat.completions.create(
|
| 90 |
+
model="gemma2-9b-it",
|
| 91 |
messages=[
|
| 92 |
{"role": "system", "content": "You are an expert travel planner."},
|
| 93 |
{"role": "user", "content": prompt}
|
|
|
|
| 99 |
)
|
| 100 |
|
| 101 |
itinerary_text = completion.choices[0].message.content
|
|
|
|
| 102 |
image_path = os.path.abspath(MOOD_IMAGES.get(mood, MOOD_IMAGES["Any"]))
|
| 103 |
+
|
| 104 |
map_html = extract_places_and_map(itinerary_text, city_context=location_text if location_text.lower() != "any destination" else None)
|
| 105 |
|
| 106 |
+
return itinerary_text, image_path, map_html
|
|
|
|
| 107 |
|
| 108 |
def generate_pdf(itinerary_text):
|
| 109 |
if not itinerary_text.strip():
|