From 961a672158f2048ff739fc0b940b20a2c7e463f4 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 21 Mar 2025 15:46:47 -0700 Subject: [PATCH] Update llama.py --- unsloth/models/llama.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 6f954bf9a2..f6c337ae36 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -1018,8 +1018,9 @@ def CausalLM_fast_forward(fast_forward_inference): *args, **kwargs, ) -> Union[Tuple, CausalLMOutputWithPast]: # Check for uninitialized DynamicCache - print(past_key_values, len(past_key_values)) - if past_key_values is not None and len(past_key_values) != 0: + if past_key_values is not None and len(past_key_values) == 0: + past_key_values = None + if past_key_values is not None: outputs = fast_forward_inference( self, input_ids,