DurgaDeepak commited on
Commit
174863b
·
verified ·
1 Parent(s): e24147c

Update knowledge_base.py

Browse files
Files changed (1) hide show
  1. knowledge_base.py +7 -8
knowledge_base.py CHANGED
@@ -49,17 +49,16 @@ def create_vectorstore(chunks):
49
  return db
50
 
51
  def load_vectorstore():
 
52
  embeddings = HuggingFaceEmbeddings(model_name=MODEL_NAME)
53
  db = Chroma(persist_directory=CHROMA_DIR, embedding_function=embeddings)
54
 
55
- # === DEBUG BLOCK ===
56
  try:
57
- data = db.get()
58
- doc_count = len(data["documents"])
59
- print(f"📦 Vectorstore Loaded: {doc_count} documents")
60
- if doc_count > 0:
61
- print(f"🧾 First doc snippet: {data['documents'][0][:100]}...")
62
  except Exception as e:
63
- print(f"❌ Failed to load vectorstore: {e}")
64
 
65
- return db
 
49
  return db
50
 
51
  def load_vectorstore():
52
+ print("📂 Loading from:", CHROMA_DIR)
53
  embeddings = HuggingFaceEmbeddings(model_name=MODEL_NAME)
54
  db = Chroma(persist_directory=CHROMA_DIR, embedding_function=embeddings)
55
 
56
+ # Debug block
57
  try:
58
+ docs = db.get()
59
+ print(f"✅ Loaded vectorstore with {len(docs['documents'])} docs")
60
+ print(f"🧾 First doc snippet: {docs['documents'][0][:100]}...")
 
 
61
  except Exception as e:
62
+ print(f"❌ Vectorstore load error: {e}")
63
 
64
+ return db