From 03803c5484cd1b81a361a0ea4ebfed61c6711493 Mon Sep 17 00:00:00 2001 From: eaidova Date: Mon, 23 Dec 2024 18:33:31 +0400 Subject: [PATCH] left padding --- tests/openvino/test_modeling.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/openvino/test_modeling.py b/tests/openvino/test_modeling.py index 0f166a635..142861bd1 100644 --- a/tests/openvino/test_modeling.py +++ b/tests/openvino/test_modeling.py @@ -1295,7 +1295,15 @@ 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