From 47c9ce4ab37d9e90177442628445a3be24aa4fee Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 12 May 2025 02:35:31 -0700 Subject: [PATCH] Fix GRPO eval --- pyproject.toml | 4 ++-- unsloth/models/_utils.py | 2 +- unsloth/models/llama.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6e85d76de2..f02df71818 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ triton = [ ] huggingface = [ - "unsloth_zoo>=2025.4.4", + "unsloth_zoo>=2025.5.1", "packaging", "tyro", "transformers>=4.51.3,!=4.47.0", @@ -381,7 +381,7 @@ colab-ampere-torch220 = [ "flash-attn>=2.6.3", ] colab-new = [ - "unsloth_zoo>=2025.4.4", + "unsloth_zoo>=2025.5.1", "packaging", "tyro", "transformers>=4.51.3,!=4.47.0", diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 90e0d9eb44..82a1d02fce 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2025.4.8" +__version__ = "2025.5.1" __all__ = [ "SUPPORTS_BFLOAT16", diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 65c7334f51..2145571ae1 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -1076,7 +1076,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 self.training and os.environ.get("UNSLOTH_RETURN_HIDDEN_STATES", "0") == "1": + if 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(