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 _utils.py

Daniel Han6f19b9aecd09
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py
index c0a15592e5d..d92a938eee1 100644
--- a/unsloth/models/_utils.py
+++ b/unsloth/models/_utils.py
@@ -507,7 +507,7 @@ def patch_tokenizer(model, tokenizer):
"\u00BF", # Inverted question mark
]
for replacement_char in possible_replacements:
- char = tokenizer(replacement_char, add_special_tokens = False)
+ char = tokenizer(replacement_char, add_special_tokens = False).input_ids
if len(char) == 1:
# Get actual token representation
try: char = tokenizer.convert_ids_to_tokens(char[0])