Skip to content

Commit

Permalink
fix weight rerank of knowledge retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
AkisAya committed Nov 21, 2024
1 parent 94c9cad commit 2b68d92
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/core/rag/rerank/weight_rerank.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ def run(
unique_documents = []
doc_id = set()
for document in documents:
doc_id = document.metadata.get("doc_id")
if doc_id not in doc_id:
doc_id.add(doc_id)
if document.metadata["doc_id"] not in doc_id:
doc_id.add(document.metadata["doc_id"])
unique_documents.append(document)

documents = unique_documents
Expand Down

0 comments on commit 2b68d92

Please sign in to comment.