Fix mixed-image Online DPO server batches - #6968
Open
DaoyuanLi2816 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4066f7f. Configure here.
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.

What does this PR do?
Fixes #6967.
Online DPO's vLLM server path sent mixed VLM batches through
chat, but a text-only row still carried the unfilled image placeholder inserted for the batch. Passing no image for that row then raised a placeholder-countValueErrorbefore generation.This change removes only unfilled image placeholders from rows whose parallel image value is
None. Rows with images are still populated normally, and image blocks that already contain an embedded image are preserved.The regression test exercises
_generate_vllm_serverwith one image row and one text-only row, verifies the first image is inlined, and verifies the second message contains only its text block.This also follows up on the current, unresolved review finding in #6765: #6765 (comment)
Validation:
Before submitting
AI writing disclosure
Who can review?
Anyone in the community is free to review the PR once the tests have passed.
Note
Low Risk
Narrow regression fix in the vLLM server multimodal path, covered by a new unit test; no auth, data, or API surface changes.
Overview
Fixes Online DPO vLLM server generation when a batch mixes vision and text-only rows. Text-only samples still had
{"type": "image"}placeholders from batch formatting, which caused a placeholder-countValueErrorbeforechatcould run._generate_vllm_servernow preprocesses prompts when images are present: for rows withimage is None, it drops image content parts that lack an embedded"image"key, while rows with real images are unchanged and still get inlined viaprepare_multimodal_messages.Adds
test_generate_vllm_server_with_mixed_image_batch, a unit test with mocks that checks one row keeps an inlined image and the other sends text only.Reviewed by Cursor Bugbot for commit 70f0231. Bugbot is set up for automated code reviews on this repo. Configure here.