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.

Update rl.py

Daniel Han3f4768ad1e8f
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py
index 3b5204dfe2a..79e7d393ef5 100644
--- a/unsloth/models/rl.py
+++ b/unsloth/models/rl.py
@@ -442,7 +442,7 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"):
" force_float32 = True\n"
"mixed_precision_dtype = os.environ.get('UNSLOTH_MIXED_PRECISION', 'float32')\n"
"dtype = getattr(model.config, 'dtype', None) or getattr(model.config, 'torch_dtype', None)\n"
- "if dtype is None: dtype = model.get_input_embeddings().dtype\n"
+ "if dtype is None: dtype = model.get_input_embeddings().weight.dtype\n"
"from unsloth_zoo.utils import _get_dtype\n"
"dtype = _get_dtype(dtype)\n"
"float16 = dtype == torch.float16\n"