Skip to content

Commit

Permalink
left padding
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova committed Dec 23, 2024
1 parent 29abd71 commit e2ceb43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/openvino/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,10 @@ def test_beam_search(self, model_arch):
transformers_model._supports_cache_class = True
from transformers.cache_utils import DynamicCache
tokenizer.pad_token_id = tokenizer.eos_token_id
tokens = tokenizer(["Today is a nice day and I am longer", "This is me"], return_tensors="pt", padding=True)
tokenization_args = {}
if is_transformers_version(">=", "4.45") and model_arch == "gpt_neo":
tokenization_args["padding_side"] = "left"
tokens = tokenizer(["Today is a nice day and I am longer", "This is me"], return_tensors="pt", padding=True, **tokenization_args)
ov_model_stateful.generation_config.eos_token_id = None
ov_model_stateless.generation_config.eos_token_id = None
transformers_model.generation_config.eos_token_id = None
Expand Down

0 comments on commit e2ceb43

Please sign in to comment.