fix: UI tab name and reranking process for TeiFastReranking (#576)
* fix: update user-management.md * fix: reranking process when TeiFastReranking is specified. --------- Co-authored-by: Ryuichi Takano <45957617+tknrych@users.noreply.github.com> Co-authored-by: Ryuichi Takano <ryuichi.takano@jp.ricoh.com>
This commit is contained in:
parent
9039b4f32b
commit
cd87a7e35f
|
@ -11,4 +11,4 @@ Once enabled, you have access to the following features:
|
||||||
|
|
||||||
- User login/logout (located in Settings Tab)
|
- User login/logout (located in Settings Tab)
|
||||||
- User changing password (located in Settings Tab)
|
- User changing password (located in Settings Tab)
|
||||||
- Create / List / Edit / Delete user (located in Admin > User Management Tab)
|
- Create / List / Edit / Delete user (located in Resources > Users Tab)
|
||||||
|
|
|
@ -29,13 +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.")
|
||||||
|
|
||||||
def client(self, query, texts):
|
def client(self, query, texts):
|
||||||
|
if self.is_truncated == True:
|
||||||
|
max_tokens = self.max_tokens # default is 512 tokens.
|
||||||
|
truncated_texts = [text[:max_tokens] for text in texts]
|
||||||
|
|
||||||
response = session.post(
|
response = session.post(
|
||||||
url=self.endpoint_url,
|
url=self.endpoint_url,
|
||||||
json={
|
json={
|
||||||
"query": query,
|
"query": query,
|
||||||
"texts": texts,
|
"texts": truncated_texts,
|
||||||
"is_truncated": self.is_truncated, # default is True
|
"is_truncated": self.is_truncated, # default is True
|
||||||
},
|
},
|
||||||
).json()
|
).json()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user