ameursg commited on
Commit
ef4ad31
Β·
verified Β·
1 Parent(s): d603dc2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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 (optimized for T4 Small GPU)
16
  chatbot = pipeline(
17
  "text-generation",
18
- model="mistralai/Mistral-7B-Instruct-v0.1",
19
  token=HF_TOKEN,
20
- device=0 # Runs on GPU
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=300, do_sample=True, temperature=0.6, top_p=0.85)
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