Skip to content

Commit

Permalink
fix: update chromaDB persist to resolve deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
OpexRah committed Jan 18, 2025
1 parent 373b541 commit 0b816bf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/campus_rag/create_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}.")


Expand Down

0 comments on commit 0b816bf

Please sign in to comment.