Jaita commited on
Commit
e003aa9
·
verified ·
1 Parent(s): 94785f1

Update embed.py

Browse files
Files changed (1) hide show
  1. embed.py +6 -1
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="./chroma_db")
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