From 428e62b44a7d0bd7bcb170e5e2c1dc884ea39f2c Mon Sep 17 00:00:00 2001 From: songhappy Date: Wed, 4 Sep 2024 16:55:37 -0700 Subject: [PATCH] update --- python/llm/src/ipex_llm/transformers/models/llama.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/llm/src/ipex_llm/transformers/models/llama.py b/python/llm/src/ipex_llm/transformers/models/llama.py index dfbbaf003a6..873407fbddd 100644 --- a/python/llm/src/ipex_llm/transformers/models/llama.py +++ b/python/llm/src/ipex_llm/transformers/models/llama.py @@ -1579,7 +1579,7 @@ def llama_attention_forward_4_41_original( past_key_value.key_cache[self.layer_idx] = key_states past_key_value.value_cache[self.layer_idx] = value_states - if cache_position is not None: + if attention_mask is not None: new_attention_mask = attention_mask[:, :, :, 0:kv_seq_len] else: new_attention_mask = attention_mask