From bbad02dc0013d4a805072e941bf1614b75d47813 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 5 Mar 2025 04:47:44 -0800 Subject: [PATCH] Update llama.py --- unsloth/models/llama.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index e0d712164e..52b4dc2c9f 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -1069,7 +1069,7 @@ def CausalLM_fast_forward(fast_forward_inference): if labels is not None: labels = labels.to(lm_head_device) # Output last hidden states without logits if asked - if model.training and os.environ.get("UNSLOTH_RETURN_HIDDEN_STATES", "0") == "1": + if self.training and os.environ.get("UNSLOTH_RETURN_HIDDEN_STATES", "0") == "1": if num_logits_to_keep != 0: hidden_states = hidden_states[:, -num_logits_to_keep:, :] return CausalLMOutputWithPast(