Spaces:
Sleeping
Sleeping
fix engine to deal with the latest chroma
Browse files- document_qa/document_qa_engine.py +3 -1
- requirements.txt +1 -1
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
|
requirements.txt
CHANGED
@@ -15,7 +15,7 @@ watchdog
|
|
15 |
dateparser
|
16 |
|
17 |
# LLM
|
18 |
-
chromadb==0.
|
19 |
tiktoken==0.4.0
|
20 |
openai==0.27.7
|
21 |
langchain==0.0.314
|
|
|
15 |
dateparser
|
16 |
|
17 |
# LLM
|
18 |
+
chromadb==0.4.15
|
19 |
tiktoken==0.4.0
|
20 |
openai==0.27.7
|
21 |
langchain==0.0.314
|