Skip to content

Commit

Permalink
review: update comments for clarity
Browse files Browse the repository at this point in the history
Signed-off-by: Travis Johnson <tsjohnso@us.ibm.com>
  • Loading branch information
tjohnson31415 committed Feb 27, 2025
1 parent 3fbf643 commit 0543ce3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/models/encoder_decoder/vision_language/test_mllama.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ def test_regression(vllm_runner, image_assets, model, dtype, max_tokens,

# Regression tests for https://github.com/vllm-project/vllm/issues/10648

# Number of image groups is greater than the number of images provided
# Number of groups of image tokens is greater than the number of images
# provided (the whitespace between the tags is necessary)
prompt = "<|begin_of_text|><|image|> <|image|> Compare the two images" # noqa: E501
image = stop_sign
with pytest.raises(ValueError):
Expand Down
3 changes: 2 additions & 1 deletion vllm/model_executor/models/mllama.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def apply(
) -> MultiModalEncDecInputs:
mm_inputs = super().apply(prompt, mm_data, hf_processor_mm_kwargs)

# Check that the number of image tokens matches the number of images
# Check that the number of image tokens in the decoder prompt matches
# the number of images provided in mm_data
num_image_tokens = mm_inputs['prompt_token_ids'].count(
self.info.get_hf_config().image_token_index)
image_data = mm_data.get("image", [])
Expand Down

0 comments on commit 0543ce3

Please sign in to comment.