Spaces:
Sleeping
Sleeping
Update knowledge_base.py
Browse files- knowledge_base.py +8 -8
knowledge_base.py
CHANGED
|
@@ -51,14 +51,14 @@ def create_vectorstore(chunks):
|
|
| 51 |
def load_vectorstore():
|
| 52 |
embeddings = HuggingFaceEmbeddings(model_name=MODEL_NAME)
|
| 53 |
db = Chroma(persist_directory=CHROMA_DIR, embedding_function=embeddings)
|
| 54 |
-
|
|
|
|
| 55 |
try:
|
| 56 |
-
|
| 57 |
-
print("
|
| 58 |
-
|
| 59 |
-
|
| 60 |
except Exception as e:
|
| 61 |
-
print(f"❌
|
| 62 |
-
|
| 63 |
-
return db
|
| 64 |
|
|
|
|
|
|
| 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 |
+
docs = db.get()
|
| 58 |
+
print("📦 Loaded vectorstore:")
|
| 59 |
+
print(f"- Total docs: {len(docs['documents'])}")
|
| 60 |
+
print(f"- First doc: {docs['documents'][0][:100]}...")
|
| 61 |
except Exception as e:
|
| 62 |
+
print(f"❌ Failed to fetch documents: {e}")
|
|
|
|
|
|
|
| 63 |
|
| 64 |
+
return db
|