Skip to content

Commit 5667810

Browse files
authored
Update flag_models.py
1 parent ef00b42 commit 5667810

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

FlagEmbedding/flag_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def encode_queries(self, queries: Union[List[str], str],
121121
return_tensors=None,
122122
add_special_tokens=False
123123
)
124-
new_max_length = (len(prefix_ids) + len(suffix_ids) + max_length) // 8 * 8 + 8
124+
new_max_length = (len(prefix_ids) + len(suffix_ids) + max_length + 8) // 8 * 8 + 8
125125
sentences_batch = self.tokenizer.batch_decode(inputs['input_ids'])
126126
for i in range(len(sentences_batch)):
127127
sentences_batch[i] = self.prefix + sentences_batch[i] + self.suffix

0 commit comments

Comments
 (0)