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.

Bug fix

Daniel Hand5c427adeae2
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py
index 0f0d4c159fe..36e4f51a276 100644
--- a/unsloth/models/_utils.py
+++ b/unsloth/models/_utils.py
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "2025.3.1"
+__version__ = "2025.3.2"
__all__ = [
"SUPPORTS_BFLOAT16",
diff --git a/unsloth/tokenizer_utils.py b/unsloth/tokenizer_utils.py
index 9c5f825a0c2..de9f73d7a5c 100644
--- a/unsloth/tokenizer_utils.py
+++ b/unsloth/tokenizer_utils.py
@@ -859,6 +859,7 @@ pass
import inspect
from inspect import getsource
+import trl
import trl.trainer.sft_trainer
from trl.trainer.sft_trainer import *
from transformers.trainer import *
@@ -1046,3 +1047,9 @@ pass
# Finally patch TRL tokenizer things -> moved to RL
# patch_sft_trainer_tokenizer()
+
+# Temporary measure to stop tokenizing data twice
+if hasattr(trl, "data_utils"):
+ def maybe_apply_chat_template(example, *args, **kwargs): return example
+ trl.data_utils.maybe_apply_chat_template = maybe_apply_chat_template
+pass