Skip to content

Commit

Permalink
fix condition to establish when we need to cleanup the storage
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Nov 29, 2023
1 parent 153c004 commit ba399dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion document_qa/document_qa_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ def create_memory_embeddings(self, pdf_path, doc_id=None, chunk_size=500, perc_o
else:
hash = metadata[0]['hash']

if hash not in self.embeddings_dict.keys():
if hash not in self.embeddings_dict.keys() and (
'documents' in self.embeddings_dict.get() and len(self.embeddings_dict.get()['documents']) == 0):
self.embeddings_dict[hash] = Chroma.from_texts(texts,
embedding=self.embedding_function,
metadatas=metadata,
Expand Down

0 comments on commit ba399dc

Please sign in to comment.