Skip to content

Commit 544b9ed

Browse files
committed
fix(llava_onevision2): forward static images to image_processor
The image branch of _build_messages only appended the chat-template entry but did not push the image into all_pil_images, so generate_until passed images=None for static-image tasks. The <|image_pad|> placeholders then had no pixel_values attached and the model produced near-random outputs. Mirror the video branch and collect the image into all_pil_images so it is forwarded via images=...
1 parent 7108c2c commit 544b9ed

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lmms_eval/models/chat/llava_onevision2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ def _build_messages(self, chat_message: ChatMessages):
305305
content.append({"type": "text", "text": c.text})
306306
elif c.type == "image":
307307
content.append({"type": "image", "image": c.url})
308+
all_pil_images.append(c.url)
308309
elif c.type == "video":
309310
if "timestamp" in self.messages_format:
310311
video_content, pil_images = self._process_video_with_timestamp(c.url)

0 commit comments

Comments
 (0)