Repository navigation
Studio: fix broken Chinese, Japanese and emoji text in gpt-oss replies - #11720
Merged
Merged
Conversation
Stripping U+FFFD from every channel segment deferred a closed segment's trailing replacement character until end(), which then emitted it after later channels, so reasoning text could land after </think> in the answer. Strip only the trailing U+FFFD of the whole decode in put(), as _mlx_stop_cut does; end() decodes everything again and releases any bytes that never resolved. The stop-sequence path is unchanged, since _mlx_stop_cut already keeps its cut off an unresolved tail.
Collaborator
|
Pushed one follow-up commit on top of this PR:
Validation: |
Collaborator
|
Codex review and CI on a staging copy with the same head (
|
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
unslothai#11720) HarmonyTextStreamer now holds back the trailing U+FFFD of each decode until the next token resolves it, so a character split across tokens is no longer shown as a replacement character and lost. end() still delivers bytes that never resolve.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When chatting with gpt-oss, characters like Chinese, Japanese and emoji sometimes show up as � or go missing. This happens when one character is split across two pieces of the reply.
This waits until the character is complete before sending it.