mirror of
https://github.com/lancedb/lancedb.git
synced 2026-08-19 04:28:35 +00:00
fix: answerdotai rerankers argument passing (#2117)
This fixes an issue for people wishing to use different kinds of rerankers in lancedb via AnswerDotAI rerankers. Currently, the arguments are passed sequentially, but they don't match the[Reranker class implementation](https://github.com/AnswerDotAI/rerankers/blob/d604a8c47d7a9fce1b6ef0cec53f0e807d6cc0fa/rerankers/reranker.py#L179): the second argument is expected to be an optional "lang" for default models, while model_type should be passed explicitly. The one line changes in this PR fixes it and enables the use of other methods (eg LLMs-as-rerankers)
This commit is contained in:
@@ -42,7 +42,9 @@ class AnswerdotaiRerankers(Reranker):
|
||||
rerankers = attempt_import_or_raise(
|
||||
"rerankers"
|
||||
) # import here for faster ops later
|
||||
self.reranker = rerankers.Reranker(model_name, model_type, **kwargs)
|
||||
self.reranker = rerankers.Reranker(
|
||||
model_name=model_name, model_type=model_type, **kwargs
|
||||
)
|
||||
|
||||
def _rerank(self, result_set: pa.Table, query: str):
|
||||
docs = result_set[self.column].to_pylist()
|
||||
|
||||
Reference in New Issue
Block a user