Update app.py
Browse files
app.py
CHANGED
|
@@ -12,12 +12,12 @@ if HF_TOKEN:
|
|
| 12 |
else:
|
| 13 |
raise ValueError("π¨ Hugging Face token not found! Please add it to Secrets in your Hugging Face Space.")
|
| 14 |
|
| 15 |
-
# Load AI model (
|
| 16 |
chatbot = pipeline(
|
| 17 |
"text-generation",
|
| 18 |
-
model="
|
| 19 |
token=HF_TOKEN,
|
| 20 |
-
device=0 #
|
| 21 |
)
|
| 22 |
|
| 23 |
def generate_itinerary(destination, start_date, end_date, traveler_type, companion):
|
|
@@ -39,7 +39,7 @@ def generate_itinerary(destination, start_date, end_date, traveler_type, compani
|
|
| 39 |
- π **Night**: Experience [Cultural/Nightlife Activity]
|
| 40 |
"""
|
| 41 |
|
| 42 |
-
response = chatbot(prompt, max_length=
|
| 43 |
return response[0]['generated_text']
|
| 44 |
|
| 45 |
# Creating a simple user interface
|
|
|
|
| 12 |
else:
|
| 13 |
raise ValueError("π¨ Hugging Face token not found! Please add it to Secrets in your Hugging Face Space.")
|
| 14 |
|
| 15 |
+
# Load AI model (Optimized for Hugging Face GPU)
|
| 16 |
chatbot = pipeline(
|
| 17 |
"text-generation",
|
| 18 |
+
model="TheBloke/Mistral-7B-Instruct-v0.1-GGUF", # Updated to GGUF version
|
| 19 |
token=HF_TOKEN,
|
| 20 |
+
device=0 # Ensures it runs on GPU
|
| 21 |
)
|
| 22 |
|
| 23 |
def generate_itinerary(destination, start_date, end_date, traveler_type, companion):
|
|
|
|
| 39 |
- π **Night**: Experience [Cultural/Nightlife Activity]
|
| 40 |
"""
|
| 41 |
|
| 42 |
+
response = chatbot(prompt, max_length=250, do_sample=True, temperature=0.6, top_p=0.85)
|
| 43 |
return response[0]['generated_text']
|
| 44 |
|
| 45 |
# Creating a simple user interface
|