From 5b35373d3720a1f882e5f44f32564ba0c0c75b8c Mon Sep 17 00:00:00 2001 From: adi1703 Date: Wed, 10 Jun 2026 13:09:21 +0530 Subject: [PATCH] Update create_database.py --- create_database.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/create_database.py b/create_database.py index bc1bafe4e..31fb4da7c 100644 --- a/create_database.py +++ b/create_database.py @@ -60,8 +60,14 @@ def save_to_chroma(chunks: list[Document]): shutil.rmtree(CHROMA_PATH) # Create a new DB from the documents. +from langchain_openai import OpenAIEmbeddings + + embeddings = OpenAIEmbeddings(model="text-embedding-3-small") + db = Chroma.from_documents( - chunks, OpenAIEmbeddings(), persist_directory=CHROMA_PATH + chunks, + embeddings, + persist_directory=CHROMA_PATH ) db.persist() print(f"Saved {len(chunks)} chunks to {CHROMA_PATH}.")