Karthikeyen92
commited on
Commit
•
46e6632
1
Parent(s):
5761cc2
Update py/db_storage.py
Browse files- py/db_storage.py +3 -2
py/db_storage.py
CHANGED
@@ -30,8 +30,9 @@ def clear_db(hugg = False):
|
|
30 |
|
31 |
class DBStorage:
|
32 |
def __init__(self, hugg = False):
|
|
|
33 |
self.CHROMA_PATH = CHROMA_DB_PATH
|
34 |
-
if hugg:
|
35 |
self.CHROMA_PATH = CHROMA_DB_PATHH
|
36 |
self.vector_store = None
|
37 |
self.client = chromadb.PersistentClient(path=self.CHROMA_PATH)
|
@@ -161,7 +162,7 @@ class DBStorage:
|
|
161 |
print(len(chunks))
|
162 |
# self.create_embeddings(chunks)
|
163 |
vector_store = self.create_vector_store(chunks)
|
164 |
-
check_and_delete(FAISS_DB_PATH)
|
165 |
vector_store.save_local(FAISS_DB_PATH)
|
166 |
|
167 |
def check_and_delete(PATH, hugg=False):
|
|
|
30 |
|
31 |
class DBStorage:
|
32 |
def __init__(self, hugg = False):
|
33 |
+
self.hugg = hugg
|
34 |
self.CHROMA_PATH = CHROMA_DB_PATH
|
35 |
+
if self.hugg:
|
36 |
self.CHROMA_PATH = CHROMA_DB_PATHH
|
37 |
self.vector_store = None
|
38 |
self.client = chromadb.PersistentClient(path=self.CHROMA_PATH)
|
|
|
162 |
print(len(chunks))
|
163 |
# self.create_embeddings(chunks)
|
164 |
vector_store = self.create_vector_store(chunks)
|
165 |
+
check_and_delete(FAISS_DB_PATH, self.hugg)
|
166 |
vector_store.save_local(FAISS_DB_PATH)
|
167 |
|
168 |
def check_and_delete(PATH, hugg=False):
|