Skip to content

[Fix] Render GLM-5.3-Flash assistant media as placeholder markers - #2193

Merged
jayhenry merged 2 commits into
InternLM:mainfrom
ShilohYu:fix/glm53-media-placeholder-render
Oct 23, 2026
Merged

jayhenry merged 2 commits into
InternLM:mainfrom
ShilohYu:fix/glm53-media-placeholder-render

Conversation

@ShilohYu

@ShilohYu ShilohYu commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

改动:glm53_chat 落地本地 _assistant_content_and_reasoning——函数体与 glm52 版相同,但 _visible_text 按定义处模块解析:import glm52 的版本会把 assistant 媒体降级成 < reminder >,本地版走 glm53 的 placeholder。

同一个输入(assistant 消息带一张图):

改前(main): <|assistant|>You are unable to process this image ...ANS<|endoftext|>
改后(本 PR): <|assistant|><|begin_of_image|><|image|><|end_of_image|>ANS<|endoftext|>

Comment thread xtuner/v1/data_proto/messages/glm53_chat.py Outdated
@ShilohYu
ShilohYu changed the base branch from main to fix/glm53-structured-tool-response October 19, 2026 09:10
@ShilohYu
ShilohYu force-pushed the fix/glm53-structured-tool-response branch from 81b3780 to d3401f1 Compare October 19, 2026 14:42
@ShilohYu
ShilohYu force-pushed the fix/glm53-media-placeholder-render branch from 80b8fd2 to e7e9355 Compare October 19, 2026 14:42
@ShilohYu
ShilohYu force-pushed the fix/glm53-structured-tool-response branch from d3401f1 to 9f00e57 Compare October 20, 2026 06:42
@ShilohYu
ShilohYu force-pushed the fix/glm53-media-placeholder-render branch from e7e9355 to 76690ac Compare October 20, 2026 06:42
@ShilohYu
ShilohYu force-pushed the fix/glm53-media-placeholder-render branch 3 times, most recently from 69699d7 to fac9750 Compare October 23, 2026 10:16
@ShilohYu
ShilohYu changed the base branch from fix/glm53-structured-tool-response to main October 23, 2026 10:16
@ShilohYu
ShilohYu force-pushed the fix/glm53-media-placeholder-render branch from fac9750 to 3ab7fbb Compare October 23, 2026 11:15
)


def _visible_text(content: Any, _literal_spans=None, _offset: int = 0) -> str:

@jayhenry jayhenry Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个重复函数可以去掉, 复用或者改为调用 glm52 里的

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改:glm53 的 _visible_text 现在委托给 glm52 的共享实现,并传入 _MEDIA_PLACEHOLDER,保留 GLM-5.3 的媒体占位符行为(commit 9fea4c1)。验证:tests/datasets/test_glm53_chat.py 45 passed;ruff、ruff-format、mypy 和 pre-commit 检查通过。

@jayhenry
jayhenry force-pushed the fix/glm53-media-placeholder-render branch from 9fea4c1 to b772b2f Compare October 23, 2026 12:05
@jayhenry
jayhenry marked this pull request as ready for review October 23, 2026 12:05
@jayhenry
jayhenry merged commit dbd54c2 into InternLM:main Oct 23, 2026
5 of 6 checks passed
@ShilohYu
ShilohYu deleted the fix/glm53-media-placeholder-render branch October 26, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants