File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
libs/kotaemon/kotaemon/rerankings Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -29,12 +29,18 @@ class TeiFastReranking(BaseReranking):
29
29
),
30
30
)
31
31
is_truncated : Optional [bool ] = Param (True , help = "Whether to truncate the inputs" )
32
- max_tokens : Optional [int ] = Param (512 , help = "This option is used to specify the maximum number of tokens supported by the reranker model." )
32
+ max_tokens : Optional [int ] = Param (
33
+ 512 ,
34
+ help = (
35
+ "This option is used to specify the "
36
+ "maximum number of tokens supported by the reranker model."
37
+ ),
38
+ )
33
39
34
40
def client (self , query , texts ):
35
- if self .is_truncated == True :
36
- max_tokens = self .max_tokens # default is 512 tokens.
37
- truncated_texts = [text [:max_tokens ] for text in texts ]
41
+ if self .is_truncated :
42
+ max_tokens = self .max_tokens # default is 512 tokens.
43
+ truncated_texts = [text [:max_tokens ] for text in texts ]
38
44
39
45
response = session .post (
40
46
url = self .endpoint_url ,
You can’t perform that action at this time.
0 commit comments