Skip to content

fix: include image placeholder in chat template for VLM GRPO training#59

Merged
abrichr merged 1 commit intomainfrom
fix/chat-template-image-tokens
Mar 22, 2026
Merged

fix: include image placeholder in chat template for VLM GRPO training#59
abrichr merged 1 commit intomainfrom
fix/chat-template-image-tokens

Conversation

@abrichr
Copy link
Copy Markdown
Member

@abrichr abrichr commented Mar 22, 2026

Fixes ValueError in Qwen2.5-VL GRPO. Both agent_fn and _compute_rollout_loss now include image content blocks in messages for apply_chat_template.

Qwen2.5-VL requires <|image_pad|> tokens in the input. These are
inserted by apply_chat_template only when messages include
{"type": "image"} content blocks.

Fixed both agent_fn and _compute_rollout_loss.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@abrichr abrichr merged commit 6617e02 into main Mar 22, 2026
4 checks passed
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.

1 participant