Skip to content

Commit

Permalink
fix max_seq_length
Browse files Browse the repository at this point in the history
  • Loading branch information
Samoed committed Dec 14, 2024
1 parent 1d7b250 commit d54ba1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mteb/models/jasper_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit d54ba1b

Please sign in to comment.