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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Update tokenizer_utils.py
Daniel Han-Chen426949c3a84a
diff --git a/unsloth/tokenizer_utils.py b/unsloth/tokenizer_utils.pyindex 1cbe49b7ae7..a03491669f0 100644--- a/unsloth/tokenizer_utils.py+++ b/unsloth/tokenizer_utils.py@@ -719,9 +719,9 @@ from inspect import getsourceimport trl.trainer.sft_trainerfrom trl.trainer.sft_trainer import *-def fix_sft_trainer_tokenizer():+def patch_sft_trainer_tokenizer():"""- Fixes double adding BOS tokens like in llama-3+ Patches the trainer with changes"""for function_name, replacer in (("_prepare_non_packed_dataloader", "def tokenize(element):",),@@ -747,10 +747,8 @@ def fix_sft_trainer_tokenizer():function = function.replace(replacer, check_text + replacer)exec(function, globals())- # Replace TRL's SFTTrainerexec(f"trl.trainer.sft_trainer.SFTTrainer.{function_name} = {function_name}", globals())passpass-# Fixes double adding BOS tokens like in llama-3-fix_sft_trainer_tokenizer()+patch_sft_trainer_tokenizer()