You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
If the model generates </think> token in the thoughts it breaks the generation #7066
Note: Please do not remove the questions. Answer beside them.
Did you update? pip install --upgrade unsloth unsloth_zoo
Yes, updated 10.7.2026
Colab or Kaggle or local / cloud
local
Number GPUs used, use nvidia-smi
1, 5070Ti, mobile version
Which notebook? Please link!
Which Unsloth version, TRL version, transformers version, PyTorch version?
v0.1.481-beta, trl who knows, transformers 5.5/5.3 pre-installed as installer says, pytorch whoknows torchao 0.17 installed by the curl update of unsloth
Inference.
Model cannot deal with scripts like training scripts with included within, breaks thinking blocks and the whole chat at times. tested with Qwen3.6 35b a3b Q8
Literal </think> (and <think>) breaking the thinking block — the main report / screenshot case.
<|im_start|> / <|im_end|> in user / system / tool text: those markers are neutralized before the prompt is built, so pasting ChatML-style script text into the chat no longer injects real turn delimiters into the template / thinking path.
What it does not fully solve yet
If the model itself generates raw <|im_start|> / <|im_end|> inside an assistant answer (e.g. writing a training script), that can still interact badly with stop sequences or the next turn’s chat template. That’s a related but separate “control tokens in model output” problem from the mid-thought </think> close. Happy to follow up on that path if it still breaks for you after this PR.
If you can try the PR build (or the next Studio release that includes it) with:
a user message that contains </think>, and
a prompt/script paste that contains <|im_start|>,
and report whether thinking/chat still breaks, that would help a lot.
Activity
Eridict commentedon Jul 18, 2026
Little update, the chat also does not like generating things like <|im_start|>, using it to make scripts for these sorts of things is not viable.
Souravrajvi0 commentedon Jul 22, 2026
Thanks for the extra detail about
<|im_start|>— we did take that into account in the fix.PR: #7334
What this PR covers
</think>(and<think>) breaking the thinking block — the main report / screenshot case.<|im_start|>/<|im_end|>in user / system / tool text: those markers are neutralized before the prompt is built, so pasting ChatML-style script text into the chat no longer injects real turn delimiters into the template / thinking path.What it does not fully solve yet
If the model itself generates raw
<|im_start|>/<|im_end|>inside an assistant answer (e.g. writing a training script), that can still interact badly with stop sequences or the next turn’s chat template. That’s a related but separate “control tokens in model output” problem from the mid-thought</think>close. Happy to follow up on that path if it still breaks for you after this PR.If you can try the PR build (or the next Studio release that includes it) with:
</think>, and<|im_start|>,and report whether thinking/chat still breaks, that would help a lot.
fix(studio): close unslothai#7066 Codex gaps for think markup neutral…
Close unslothai#7066 gaps in tool schemas, tool-call args, holdback, …
Close remaining unslothai#7066 gaps: parsed tool-call args, tool-loop…
Neutralize Llama-3 turn sentinels in non-assistant text (unslothai#7066)
Merge origin/main into the unslothai#7334 branch
Resolve held close tags at a tool-call boundary and across every text…
Merge branch 'main' into r7334
Cover Harmony, the count path and escaped mentions for PR unslothai#7334
Cover the four render paths that skip the unslothai#7066 choke point
Tighten the comments added by the unslothai#7066 control-markup fix
35 remaining items
fix(studio): neutralize chat-template control markup in client text (#…
fix(studio): sanitize the healer catalog when no render target is ava…
Pick the template target through chat_render_target, and measure a qu…
Studio: honor MLX KV cache quantization and chat template overrides (#…
authorize the sanitized tool catalog and drain the tool worker
authorize the sanitized tool catalog and drain the tool worker
Studio: measure a tool result as the request will carry it
Studio: size a tool result against the room the thread has left (#9563)
fix(studio): normalize Muse Glimmer's recipient-addressed protocol (#…
Keep the tool catalog and the conversation when a picture is in the p…
Authorize image-turn healing from the template that renders the image…
Studio: keep tools available when a picture is attached (#10092)
feat(studio/voice): voice conversation mode on the current audio stack
Studio: keep angle-bracket text in user turns on the safetensors fall…