From 5f5d2050283ec22667a5352b85d00bbb75c858f0 Mon Sep 17 00:00:00 2001 From: Fanli Lin Date: Fri, 7 Jun 2024 00:48:53 +0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com> --- optimum/intel/utils/modeling_utils.py | 2 +- tests/ipex/test_modeling.py | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/optimum/intel/utils/modeling_utils.py b/optimum/intel/utils/modeling_utils.py index b213ea3107..3541f4f933 100644 --- a/optimum/intel/utils/modeling_utils.py +++ b/optimum/intel/utils/modeling_utils.py @@ -184,7 +184,7 @@ def recursive_to_device(value, device): return value -def setattr_from_module(new_module, module): +def _setattr_from_module(new_module, module): for k, v in module.__dict__.items(): setattr(new_module, k, v) for k, v in module.__class__.__dict__.items(): diff --git a/tests/ipex/test_modeling.py b/tests/ipex/test_modeling.py index 1ea653eedc..8664b99cee 100644 --- a/tests/ipex/test_modeling.py +++ b/tests/ipex/test_modeling.py @@ -242,10 +242,6 @@ def test_pipeline(self, model_arch): # High optimized model llama is not supported assisted decoding for now. @parameterized.expand(SUPPORTED_ARCHITECTURES) - @unittest.skipIf( - is_ipex_version(">=", "2.3.0"), - reason="CPU IPEXModel does not support assisted decoding when ipex version >= 2.3.0", - ) def test_assisted_decoding(self, model_arch): if model_arch == "llama2": return @@ -301,10 +297,6 @@ def test_ipex_patching_beam_search(self, test_name, model_arch, use_cache): self.assertIsInstance(outputs, torch.Tensor) self.assertTrue(torch.equal(outputs, transformers_outputs)) - @unittest.skipIf( - is_ipex_version(">=", "2.3.0"), - reason="CPU IPEXModel only supports with past_key_values for ipex version >= 2.3.0", - ) def test_compare_with_and_without_past_key_values(self): model_id = "echarlaix/tiny-random-gpt2-torchscript" tokenizer = AutoTokenizer.from_pretrained(model_id)