lfoppiano commited on
Commit
70f085d
1 Parent(s): 64372e1

fix engine to deal with the latest chroma

Browse files
Files changed (1) hide show
  1. document_qa/document_qa_engine.py +3 -1
document_qa/document_qa_engine.py CHANGED
@@ -207,7 +207,9 @@ class DocumentQAEngine:
207
  else:
208
  hash = metadata[0]['hash']
209
 
210
- self.embeddings_dict[hash] = Chroma.from_texts(texts, embedding=self.embedding_function, metadatas=metadata)
 
 
211
  self.embeddings_root_path = None
212
 
213
  return hash
 
207
  else:
208
  hash = metadata[0]['hash']
209
 
210
+ if hash not in self.embeddings_dict.keys():
211
+ self.embeddings_dict[hash] = Chroma.from_texts(texts, embedding=self.embedding_function, metadatas=metadata, collection_name=hash)
212
+
213
  self.embeddings_root_path = None
214
 
215
  return hash