Skip to content

Commit c9232d4

Browse files
[CI/Build] Update VLM common tests (#22841)
Signed-off-by: DarkLight1337 <[email protected]>
1 parent 9bd9294 commit c9232d4

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

tests/models/multimodal/generation/test_common.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@
561561
get_stop_token_ids=lambda tok: tok.convert_tokens_to_ids(['<|im_end|>', '<|endoftext|>']), # noqa: E501
562562
hf_output_post_proc=model_utils.minicpmv_trunc_hf_output,
563563
patch_hf_runner=model_utils.minicpmo_26_patch_hf_runner,
564-
# FIXME: https://huggingface.co/openbmb/MiniCPM-V-2_6/discussions/55
564+
# FIXME: https://huggingface.co/openbmb/MiniCPM-o-2_6/discussions/49
565565
marks=[pytest.mark.skip("HF import fails")],
566566
),
567567
"minicpmv_26": VLMTestInfo(
@@ -574,8 +574,6 @@
574574
get_stop_token_ids=lambda tok: tok.convert_tokens_to_ids(['<|im_end|>', '<|endoftext|>']), # noqa: E501
575575
hf_output_post_proc=model_utils.minicpmv_trunc_hf_output,
576576
patch_hf_runner=model_utils.minicpmv_26_patch_hf_runner,
577-
# FIXME: https://huggingface.co/openbmb/MiniCPM-V-2_6/discussions/55
578-
marks=[pytest.mark.skip("HF import fails")],
579577
),
580578
"minimax_vl_01": VLMTestInfo(
581579
models=["MiniMaxAI/MiniMax-VL-01"],
@@ -611,18 +609,6 @@
611609
patch_hf_runner=model_utils.ovis_patch_hf_runner,
612610
marks=[large_gpu_mark(min_gb=32)],
613611
),
614-
"ovis1_6": VLMTestInfo(
615-
models=["AIDC-AI/Ovis1.6-Llama3.2-3B"],
616-
test_type=(VLMTestType.IMAGE, VLMTestType.MULTI_IMAGE),
617-
prompt_formatter=lambda img_prompt: f"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\nYou are a helpful and honest multimodal assistant.<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n{img_prompt}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n", # noqa: E501
618-
img_idx_to_prompt=lambda idx: "<image>\n", # noqa: E501
619-
max_model_len=4096,
620-
max_num_seqs=2,
621-
dtype="half",
622-
# use sdpa mode for hf runner since ovis2 didn't work with flash_attn
623-
hf_model_kwargs={"llm_attn_implementation": "sdpa"},
624-
patch_hf_runner=model_utils.ovis_patch_hf_runner,
625-
),
626612
"ovis2": VLMTestInfo(
627613
models=["AIDC-AI/Ovis2-1B"],
628614
test_type=(VLMTestType.IMAGE, VLMTestType.MULTI_IMAGE),

vllm/model_executor/models/minicpmv.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,30 +85,13 @@ class MiniCPMVImagePixelInputs(TensorSchema):
8585
- w: Width
8686
"""
8787

88-
def _validate_nested_tensors(
89-
self,
90-
value: Union[list[torch.Tensor], tuple[torch.Tensor, ...]],
91-
field_name: str,
92-
expected_shape: tuple[Union[int, str], ...],
93-
dynamic_dims: set[str],
94-
) -> tuple[int, ...]:
95-
# value[0] is the scaled image,
96-
# and value[1:] is a collection of image slices.
97-
# It is ensured that all slices in the collection
98-
# have the same shape.
99-
if field_name == "pixel_values":
100-
value = value[1:] if len(value) > 1 else value
101-
102-
return super()._validate_nested_tensors(value, field_name,
103-
expected_shape, dynamic_dims)
104-
10588
type: Literal["pixel_values"] = "pixel_values"
10689

10790
# Note that the image size may vary, so we pass it as a list instead of a
10891
# batched tensor.
10992
pixel_values: Annotated[
11093
list[torch.Tensor],
111-
TensorShape("bns", "c", "h", "w"),
94+
TensorShape("bns", "c", "h", "w", dynamic_dims={"h", "w"}),
11295
]
11396
tgt_sizes: Annotated[
11497
torch.Tensor,

0 commit comments

Comments
 (0)