diff --git a/pyproject.toml b/pyproject.toml index 96aa0696f..14797c8fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ triton = [ "triton @ https://github.com/woct0rdho/triton-windows/releases/download/v3.1.0-windows.post5/triton-3.1.0-cp312-cp312-win_amd64.whl ; python_version=='3.12' and platform_system == 'Windows'", ] huggingface = [ - "unsloth_zoo>=2025.2.6", + "unsloth_zoo>=2025.2.7", "packaging", "tyro", "transformers>=4.46.1,!=4.47.0", @@ -50,7 +50,7 @@ huggingface = [ "wheel>=0.42.0", "numpy", "accelerate>=0.34.1", - "trl>=0.7.9,!=0.9.0,!=0.9.1,!=0.9.2,!=0.9.3", + "trl>=0.7.9,!=0.9.0,!=0.9.1,!=0.9.2,!=0.9.3,!=0.15.0", "peft>=0.7.1,!=0.11.0", "protobuf<4.0.0", "huggingface_hub", @@ -348,7 +348,7 @@ colab-ampere-torch220 = [ "flash-attn>=2.6.3", ] colab-new = [ - "unsloth_zoo>=2025.2.6", + "unsloth_zoo>=2025.2.7", "packaging", "tyro", "transformers>=4.46.1,!=4.47.0", @@ -366,7 +366,7 @@ colab-new = [ ] colab-no-deps = [ "accelerate>=0.34.1", - "trl>=0.7.9,!=0.9.0,!=0.9.1,!=0.9.2,!=0.9.3", + "trl>=0.7.9,!=0.9.0,!=0.9.1,!=0.9.2,!=0.9.3,!=0.15.0", "peft>=0.7.1", "xformers", "bitsandbytes>=0.46.1", diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 382024512..e1259af3a 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -143,6 +143,11 @@ def filter(self, x): return not (self.text in x.getMessage()) transformers_training_args_logger.addFilter(HideLoggingMessage("torch.distributed")) del transformers_training_args_logger +# No label_names provided for model class +from transformers.trainer import logger as transformers_trainer_logger +transformers_trainer_logger.addFilter(HideLoggingMessage("No label_names")) +del transformers_trainer_logger + # Using the default loss: `ForCausalLMLoss`. try: from transformers.modeling_utils import logger as transformers_modeling_utils_logger diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 909dfc339..3e0717a87 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -725,8 +725,9 @@ def LlamaModel_fast_forward( past_key_values_length, sliding_window = getattr(self.config, "sliding_window", None), ) - if attention_mask is not None: - attention_mask = attention_mask.to(torch.bool) + # Must NOT convert to bool - weirdly this causes stuff to error out! + # if attention_mask is not None: + # attention_mask = attention_mask.to(torch.bool) pass hidden_states = inputs_embeds diff --git a/unsloth/models/rl_replacements.py b/unsloth/models/rl_replacements.py index 23b31172f..06ae82140 100644 --- a/unsloth/models/rl_replacements.py +++ b/unsloth/models/rl_replacements.py @@ -164,10 +164,11 @@ def grpo_trainer__prepare_inputs(function_name, function): # Remove _move_model_to_vllm def grpo_trainer__move_model_to_vllm(function_name, function): if function_name != "_move_model_to_vllm": return function + + def _move_model_to_vllm(self, *args, **kwargs): return None - # .*? matches first match. .+? matches final match. - replacement = "def _move_model_to_vllm(self, *args, **kwargs): return None\n" - return " "*function.find("def") + replacement + function = inspect.getsource(_move_model_to_vllm) + return function pass RL_FUNCTIONS["grpo_trainer"].append(grpo_trainer__move_model_to_vllm)