Repository navigation
fix(vlm): preserve literal <image> text in Qwen rollout prompts - #2594
Open
MitsuiChen14 wants to merge 2 commits into
Open
MitsuiChen14 wants to merge 2 commits into
MitsuiChen14 wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
A Qwen rollout with one screenshot can also contain the literal text
<image>, for example in a tool response. The Qwen processor counts both the native vision span and that text as attachments. With slime's pinned SGLang patch stack, the legacy loader exhausts its image iterator and the request fails before generation.Add a processor patch to the v0.5.21 and latest bundles and apply it during Docker and conda setup. Token-ID requests use native image spans. For string requests (including slime's default image rollout), when native spans already account for all supplied images, preserve bare
<image>as text. Raw /generate shorthand and mixed shorthand/native prompts that need both slots retain their existing behavior. Use the same selection for artifact normalization and uncached loading.Related: sgl-project/sglang#54931 covers token-ID requests upstream. This also covers slime's rendered string prompts and works with its legacy loader override. The change does not alter the SGLang version pin.
Validation used offline containers, a small local tokenizer and one generated PIL image. The regression calls the Qwen3.5 processor and checks image offsets and the returned text token IDs with the literal before and after the real image, for both string and token-ID input. A control checks raw and mixed shorthand normalization.
Also ran
python tests/test_qwen_vl_image_placeholder.pyin the publishedslimerl/slime:latestimage (5 passed). These are processor integration tests; a full image rebuild, HTTP generation and RL training were not exercised.