Spaces:
Sleeping
Sleeping
Update embed.py
Browse files
embed.py
CHANGED
|
@@ -3,8 +3,13 @@ from docx import Document
|
|
| 3 |
from sentence_transformers import SentenceTransformer
|
| 4 |
import chromadb
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# Initialize ChromaDB client (persistent storage)
|
| 7 |
-
client = chromadb.PersistentClient(path=
|
| 8 |
collection = client.get_or_create_collection(name="knowledge_base")
|
| 9 |
|
| 10 |
# Load MiniLM model for embeddings
|
|
|
|
| 3 |
from sentence_transformers import SentenceTransformer
|
| 4 |
import chromadb
|
| 5 |
|
| 6 |
+
|
| 7 |
+
CHROMA_PATH = os.getenv("CHROMA_PATH", "./chroma_db")
|
| 8 |
+
os.makedirs(CHROMA_PATH, exist_ok=True)
|
| 9 |
+
print("Chroma path:", CHROMA_PATH)
|
| 10 |
+
|
| 11 |
# Initialize ChromaDB client (persistent storage)
|
| 12 |
+
client = chromadb.PersistentClient(path=CHROMA_PATH)
|
| 13 |
collection = client.get_or_create_collection(name="knowledge_base")
|
| 14 |
|
| 15 |
# Load MiniLM model for embeddings
|