Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ else:
|
|
13 |
raise ValueError("π¨ Hugging Face token not found! Please add it to Secrets in your Hugging Face Space.")
|
14 |
|
15 |
# Load a smaller AI model that fits within 16GB memory
|
16 |
-
chatbot = pipeline("text-generation", model="
|
17 |
|
18 |
def generate_itinerary(destination, start_date, end_date, traveler_type, companion):
|
19 |
"""Generates an AI-powered travel itinerary based on user preferences"""
|
@@ -27,7 +27,7 @@ def generate_itinerary(destination, start_date, end_date, traveler_type, compani
|
|
27 |
- Provide unique local recommendations based on the traveler's interests.
|
28 |
"""
|
29 |
|
30 |
-
response = chatbot(prompt, max_length=
|
31 |
return response[0]['generated_text']
|
32 |
|
33 |
# Creating a simple user interface
|
|
|
13 |
raise ValueError("π¨ Hugging Face token not found! Please add it to Secrets in your Hugging Face Space.")
|
14 |
|
15 |
# Load a smaller AI model that fits within 16GB memory
|
16 |
+
chatbot = pipeline("text-generation", model="mistralai/Mistral-7B-8Bit", token=HF_TOKEN)
|
17 |
|
18 |
def generate_itinerary(destination, start_date, end_date, traveler_type, companion):
|
19 |
"""Generates an AI-powered travel itinerary based on user preferences"""
|
|
|
27 |
- Provide unique local recommendations based on the traveler's interests.
|
28 |
"""
|
29 |
|
30 |
+
response = chatbot(prompt, max_length=150, do_sample=True, temperature=0.7, top_p=0.9)
|
31 |
return response[0]['generated_text']
|
32 |
|
33 |
# Creating a simple user interface
|