Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

disable _is_vlm (#3265)

DoubleMathew490027f988f1
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py
index 0f1fa2dbf61..fe9951ddf08 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)