From f0ba16a67d6002447c17016d7a272c3f97cf97f6 Mon Sep 17 00:00:00 2001 From: jiqing-feng Date: Tue, 26 Nov 2024 10:48:55 +0000 Subject: [PATCH] fix device Signed-off-by: jiqing-feng --- optimum/intel/ipex/modeling_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/optimum/intel/ipex/modeling_base.py b/optimum/intel/ipex/modeling_base.py index 7cf9e35861..19971dacf8 100644 --- a/optimum/intel/ipex/modeling_base.py +++ b/optimum/intel/ipex/modeling_base.py @@ -308,8 +308,8 @@ def _init_warmup(self): if not self._add_patch: # use_cache = "past_key_values" in self.input_names dummy_inputs = _prepare_inputs_for_ipex_model(self, self.export_feature, self.use_cache) - if self._device.type != "cpu": - dummy_inputs = recursive_to_device(value=dummy_inputs, device=self._device) + if self.device.type != "cpu": + dummy_inputs = recursive_to_device(value=dummy_inputs, device=self.device) for _ in range(2): self(**dummy_inputs)