fix: tei_fast_rerank logic bump:patch
This commit is contained in:
parent
54320d08df
commit
3bd19f399f
|
@ -29,10 +29,16 @@ class TeiFastReranking(BaseReranking):
|
|||
),
|
||||
)
|
||||
is_truncated: Optional[bool] = Param(True, help="Whether to truncate the inputs")
|
||||
max_tokens: Optional[int] = Param(512, help="This option is used to specify the maximum number of tokens supported by the reranker model.")
|
||||
max_tokens: Optional[int] = Param(
|
||||
512,
|
||||
help=(
|
||||
"This option is used to specify the "
|
||||
"maximum number of tokens supported by the reranker model."
|
||||
),
|
||||
)
|
||||
|
||||
def client(self, query, texts):
|
||||
if self.is_truncated == True:
|
||||
if self.is_truncated:
|
||||
max_tokens = self.max_tokens # default is 512 tokens.
|
||||
truncated_texts = [text[:max_tokens] for text in texts]
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user