From eaed3eb015b3730f912fd5c10b8969bdccadf037 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 11 Feb 2025 15:11:16 -0800 Subject: [PATCH] Patching --- unsloth/models/rl.py | 3 ++- unsloth/tokenizer_utils.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py index 0c34f50024..ab51e9cf6b 100644 --- a/unsloth/models/rl.py +++ b/unsloth/models/rl.py @@ -302,9 +302,10 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"): if "max_seq_length" in call_args: length_check = \ "if hasattr(model, 'max_seq_length') and model.max_seq_length > max_seq_length:\n"\ - " print('Unsloth: You set `max_seq_length` as ' + str(max_seq_length) + ' but the\\n'"\ + " print('Unsloth: You set `max_seq_length` as ' + str(max_seq_length) + ' but the\\n'\n"\ " 'model maximum sequence length is ' + str(model.max_seq_length) + '. We will reduce it.')\n" " max_seq_length = model.max_seq_length\n" + "if hasattr(model, 'max_seq_length') and max_seq_length is None: max_seq_length = model.max_seq_length\n" extra_args += length_check pass diff --git a/unsloth/tokenizer_utils.py b/unsloth/tokenizer_utils.py index 82e82eb686..ab3878613f 100644 --- a/unsloth/tokenizer_utils.py +++ b/unsloth/tokenizer_utils.py @@ -1056,5 +1056,5 @@ def patch_sft_trainer_tokenizer(): pass pass -# FInally patch TRL tokenizer things -patch_sft_trainer_tokenizer() +# Finally patch TRL tokenizer things +# patch_sft_trainer_tokenizer()