kendrickfff commited on
Commit
4664718
·
verified ·
1 Parent(s): da4edce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -80,20 +80,20 @@ class HybridEmbeddings(Embeddings):
80
  return self._embed_texts([text])[0]
81
 
82
  # ============================================================
83
- # --- LLM INITIALIZATION ---
84
  # ============================================================
85
  def initialize_llm():
86
  if not HF_TOKEN:
87
  raise ValueError("HF_TOKEN is not set; cannot initialize LLM.")
88
- print("🔵 Initializing LLM: HuggingFaceHub (Mistral-7B)…")
89
  try:
90
  llm = HuggingFaceHub(
91
- repo_id="mistralai/Mistral-7B-Instruct-v0.2",
92
  huggingfacehub_api_token=HF_TOKEN,
93
  model_kwargs={"temperature": 0.7, "max_length": 4096},
94
  task="text-generation",
95
  )
96
- print("✅ LLM (HuggingFace Mistral) initialized successfully.")
97
  return llm
98
  except Exception as e:
99
  print("❌ Failed to initialize LLM:", e)
 
80
  return self._embed_texts([text])[0]
81
 
82
  # ============================================================
83
+ # --- LLM INITIALIZATION
84
  # ============================================================
85
  def initialize_llm():
86
  if not HF_TOKEN:
87
  raise ValueError("HF_TOKEN is not set; cannot initialize LLM.")
88
+ print("🔵 Initializing LLM: Microsoft Phi…")
89
  try:
90
  llm = HuggingFaceHub(
91
+ repo_id="microsoft/phi-2",
92
  huggingfacehub_api_token=HF_TOKEN,
93
  model_kwargs={"temperature": 0.7, "max_length": 4096},
94
  task="text-generation",
95
  )
96
+ print("✅ LLM (Microsoft Phi) initialized successfully.")
97
  return llm
98
  except Exception as e:
99
  print("❌ Failed to initialize LLM:", e)