Skip to content

Commit

Permalink
fix engine to deal with the latest chroma
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Oct 30, 2023
1 parent 6b8f3f8 commit 4d29d85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion document_qa/document_qa_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ def create_memory_embeddings(self, pdf_path, doc_id=None, chunk_size=500, perc_o
else:
hash = metadata[0]['hash']

self.embeddings_dict[hash] = Chroma.from_texts(texts, embedding=self.embedding_function, metadatas=metadata)
if hash not in self.embeddings_dict.keys():
self.embeddings_dict[hash] = Chroma.from_texts(texts, embedding=self.embedding_function, metadatas=metadata, collection_name=hash)

self.embeddings_root_path = None

return hash
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ watchdog
dateparser

# LLM
chromadb==0.3.25
chromadb==0.4.15
tiktoken==0.4.0
openai==0.27.7
langchain==0.0.314
Expand Down

0 comments on commit 4d29d85

Please sign in to comment.