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 Han0b61f8e86eac
diff --git a/unsloth/tokenizer_utils.py b/unsloth/tokenizer_utils.pyindex 2062df4808e..5226c3c5b7f 100644--- a/unsloth/tokenizer_utils.py+++ b/unsloth/tokenizer_utils.py@@ -951,7 +951,7 @@ def patch_sft_trainer_tokenizer():check_text = check_text.split("\n")check_text = "\n".join(" "*where + x for x in check_text)check_text = check_text.rstrip() + "\n"-+if replacer is None:# .*? matches first match. .+? matches final match.replacer = re.findall(@@ -961,14 +961,10 @@ def patch_sft_trainer_tokenizer():)if len(replacer) == 0: continuereplacer = replacer[0]- print("====")- print(replacer)- print("====")function = function.replace(replacer, replacer + check_text)else:function = function.replace(replacer, check_text + replacer)pass- print(function)x = [x for x in all_imports if x in function]exec(f"from trl.trainer.sft_trainer import ({','.join(x)})", locals())