Spaces:
Sleeping
Sleeping
fix engine to deal with the latest chroma
Browse files
document_qa/document_qa_engine.py
CHANGED
@@ -207,7 +207,9 @@ class DocumentQAEngine:
|
|
207 |
else:
|
208 |
hash = metadata[0]['hash']
|
209 |
|
210 |
-
|
|
|
|
|
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
|