fix: tei_fast_rerank logic bump:patch
This commit is contained in:
parent
54320d08df
commit
3bd19f399f
|
@ -29,12 +29,18 @@ class TeiFastReranking(BaseReranking):
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
is_truncated: Optional[bool] = Param(True, help="Whether to truncate the inputs")
|
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):
|
def client(self, query, texts):
|
||||||
if self.is_truncated == True:
|
if self.is_truncated:
|
||||||
max_tokens = self.max_tokens # default is 512 tokens.
|
max_tokens = self.max_tokens # default is 512 tokens.
|
||||||
truncated_texts = [text[:max_tokens] for text in texts]
|
truncated_texts = [text[:max_tokens] for text in texts]
|
||||||
|
|
||||||
response = session.post(
|
response = session.post(
|
||||||
url=self.endpoint_url,
|
url=self.endpoint_url,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user