fix weight rerank of knowledge retrieval (#10931)

This commit is contained in:
AkisAya
2024-11-21 17:53:20 +08:00
committed by GitHub
parent 82575a7aea
commit cb0c55daa7
2 changed files with 6 additions and 7 deletions

View File

@@ -27,11 +27,11 @@ class RerankModelRunner(BaseRerankRunner):
:return:
"""
docs = []
doc_id = set()
doc_ids = set()
unique_documents = []
for document in documents:
if document.provider == "dify" and document.metadata["doc_id"] not in doc_id:
doc_id.add(document.metadata["doc_id"])
if document.provider == "dify" and document.metadata["doc_id"] not in doc_ids:
doc_ids.add(document.metadata["doc_id"])
docs.append(document.page_content)
unique_documents.append(document)
elif document.provider == "external":