Infinity-1995 commited on
Commit
1d60b25
·
verified ·
1 Parent(s): b64c2b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -59,13 +59,11 @@ def generate_itinerary(mood, location, budget, days):
59
  image_path = MOOD_IMAGES.get(mood, MOOD_IMAGES["Any"])
60
  return itinerary_text, image_path, gr.update(visible=True)
61
 
62
- def generate_pdf(itinerary_text, location="Destination", days=5):
63
  if not itinerary_text.strip():
64
  return None
65
-
66
- # Create a nice filename
67
- safe_location = re.sub(r'[^A-Za-z0-9]+', '_', location.strip())
68
- filename = f"itinerary_{safe_location}_{days}_days.pdf"
69
  file_path = os.path.join(tempfile.gettempdir(), filename)
70
 
71
  # Prepare the document template with letter page size
 
59
  image_path = MOOD_IMAGES.get(mood, MOOD_IMAGES["Any"])
60
  return itinerary_text, image_path, gr.update(visible=True)
61
 
62
+ def generate_pdf(itinerary_text):
63
  if not itinerary_text.strip():
64
  return None
65
+ # Use a static friendly name (e.g., "feelaway_itinerary.pdf")
66
+ filename = "feelaway_itinerary.pdf"
 
 
67
  file_path = os.path.join(tempfile.gettempdir(), filename)
68
 
69
  # Prepare the document template with letter page size