Skip to content

Commit d797cc9

Browse files
committed
Fix _init_warmup use_cache condition
1 parent e5b425d commit d797cc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

optimum/intel/ipex/modeling_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def _call_model(self, *args, **kwargs):
227227
def _init_warmup(self):
228228
# warmup, the first 2 forwards of an IPEX model include some preprocessing steps and
229229
# the results of the compute are unpredictable
230-
use_cache = getattr(self, "use_cache", getattr(self.config, "use_cache", False))
230+
use_cache = "past_key_values" in self.input_names
231231
dummy_inputs = prepare_jit_inputs(self, self.export_feature, use_cache)
232232
for _ in range(2):
233233
self(**dummy_inputs)

0 commit comments

Comments
 (0)