From 0b816bfda77a21d85d50b2dd3efb4a5a2768a827 Mon Sep 17 00:00:00 2001 From: OpexRah Date: Sun, 19 Jan 2025 01:59:26 +0530 Subject: [PATCH] fix: update chromaDB persist to resolve deprecation warning --- src/campus_rag/create_database.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/campus_rag/create_database.py b/src/campus_rag/create_database.py index 29513e1..8ef61d0 100644 --- a/src/campus_rag/create_database.py +++ b/src/campus_rag/create_database.py @@ -56,8 +56,7 @@ def save_to_chroma(chunks: list[Document]): if os.path.exists(CHROMA_PATH): shutil.rmtree(CHROMA_PATH) - db = Chroma.from_documents(chunks, embeddings, persist_directory=CHROMA_PATH) - db.persist() + Chroma.from_documents(chunks, embeddings, persist_directory=CHROMA_PATH) print(f"Saved {len(chunks)} chunks to {CHROMA_PATH}.")