From d54ba1bf30bee66cd392d86a17c292d068f4b71e Mon Sep 17 00:00:00 2001 From: Roman Solomatin <36135455+Samoed@users.noreply.github.com> Date: Sat, 14 Dec 2024 22:52:54 +0300 Subject: [PATCH] fix max_seq_length --- mteb/models/jasper_models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mteb/models/jasper_models.py b/mteb/models/jasper_models.py index c10619136..00b637ed3 100644 --- a/mteb/models/jasper_models.py +++ b/mteb/models/jasper_models.py @@ -23,11 +23,13 @@ def __init__( model_name: str, revision: str, instruction_template: str | Callable[[str], str] | None = None, + max_seq_length: int = 2048, **kwargs: Any, ): self.model_name = model_name self.model = SentenceTransformer(model_name, revision=revision, **kwargs) self.instruction_template = instruction_template + self.model.max_seq_length = max_seq_length def encode( self, @@ -65,9 +67,9 @@ def encode( model_kwargs={ "attn_implementation": "sdpa", "torch_dtype": torch.float16, - "max_seq_length": 2048, }, trust_remote_code=True, + max_seq_length=2048, instruction_template="Instruct: {instruction}\nQuery: ", ), name="infgrad/jasper_en_vision_language_v1",