Skip to content

Commit

Permalink
fix: langchain integration attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
bclavie committed Mar 19, 2024
1 parent cefcbda commit a7b8fa9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ packages = [
name = "rerankers"


version = "0.1.0post1"
version = "0.1.1"

description = "A unified API for various document re-ranking models."

Expand Down
2 changes: 1 addition & 1 deletion rerankers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from rerankers.reranker import Reranker

__all__ = ["Reranker"]
__version__ = "0.1.0post1"
__version__ = "0.1.1"
4 changes: 2 additions & 2 deletions rerankers/integrations/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def compress_documents(
)
final_results = []
for r in results.top_k(kwargs.get("k", self.k)):
doc = doc_list[r["doc_id"]]
doc.metadata["relevance_score"] = r["score"]
doc = doc_list[r.doc_id]
doc.metadata["relevance_score"] = r.score
final_results.append(doc)
return final_results

0 comments on commit a7b8fa9

Please sign in to comment.