diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py index 0f1fa2dbf6..fe9951ddf0 100644 --- a/unsloth/models/rl.py +++ b/unsloth/models/rl.py @@ -727,6 +727,13 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"): new_text = 'self._signature_columns = ["input_ids", "attention_mask", "completion_mask","labels"]' RLTrainer_source = RLTrainer_source.replace(original_text, new_text) + # Temporary patch _is_vlm to False + # as of 0.22 it only exists in sfttrainer + oriignal_is_vlm_text = 'self._is_vlm = True' + new_is_vlm_text = 'self._is_vlm = False' + RLTrainer_source = RLTrainer_source.replace(oriignal_is_vlm_text, new_is_vlm_text) + + # Remove multiple doc strings if __RLConfig_doc__ != "" and RLTrainer_source.count(__RLTrainer_doc__) == 2: RLTrainer_source = RLTrainer_source.replace(__RLTrainer_doc__, "", 1)