@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 18016a5e62
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 00:45 UTC

[Bugfix] Fix CI failures for InternVL and Mantis models (#12728)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>

Cyrus Leung committed Feb 4, 2025 at 23:54 UTC 18016a5e627d2a4b69af599272a5aa8ce71b98c8
4 files changed +79 -412
tests/models/decoder_only/vision_language/test_models.py
+9 -8
@@ -9,6 +9,7 @@ from pathlib import PosixPath
9 from typing import Type
10
11 import pytest
12 +from packaging.version import Version
13 from transformers import AutoModelForVision2Seq
14 from transformers import __version__ as TRANSFORMERS_VERSION
15
@@ -154,13 +155,7 @@ VLM_TEST_SETTINGS = {
155 stop_str=["<|im_end|>"],
156 image_size_factors=[(0.10, 0.15)],
157 max_tokens=64,
157 - marks=[
158 - pytest.mark.skipif(
159 - TRANSFORMERS_VERSION < "4.48.0",
160 - reason="HF model requires transformers>=4.48.0",
161 - ),
162 - large_gpu_mark(min_gb=64),
163 - ],
158 + marks=[large_gpu_mark(min_gb=64)],
159 ),
160 "blip2": VLMTestInfo(
161 models=["Salesforce/blip2-opt-2.7b"],
@@ -206,7 +201,7 @@ VLM_TEST_SETTINGS = {
201 image_size_factors=[(), (1.0, ), (1.0, 1.0, 1.0), (0.1, 0.5, 1.0)],
202 marks=[
203 pytest.mark.skipif(
209 - TRANSFORMERS_VERSION >= "4.48.0",
204 + Version(TRANSFORMERS_VERSION) >= Version("4.48"),
205 reason="HF model is not compatible with transformers>=4.48.0",
206 )
207 ],
@@ -339,6 +334,12 @@ VLM_TEST_SETTINGS = {
334 auto_cls=AutoModelForVision2Seq,
335 vllm_output_post_proc=model_utils.mantis_vllm_to_hf_output,
336 patch_hf_runner=model_utils.mantis_patch_hf_runner,
337 + marks=[
338 + pytest.mark.skipif(
339 + Version(TRANSFORMERS_VERSION) >= Version("4.48"),
340 + reason="HF model is not compatible with transformers>=4.48.0",
341 + )
342 + ],
343 ),
344 "minicpmv_25": VLMTestInfo(
345 models=["openbmb/MiniCPM-Llama3-V-2_5"],
tests/models/registry.py
+1 -2
@@ -224,8 +224,7 @@ _CROSS_ENCODER_EXAMPLE_MODELS = {
224
225 _MULTIMODAL_EXAMPLE_MODELS = {
226 # [Decoder-only]
227 - "AriaForConditionalGeneration": _HfExamplesInfo("rhymes-ai/Aria",
228 - min_transformers_version="4.48"),
227 + "AriaForConditionalGeneration": _HfExamplesInfo("rhymes-ai/Aria"),
228 "Blip2ForConditionalGeneration": _HfExamplesInfo("Salesforce/blip2-opt-2.7b"), # noqa: E501
229 "ChameleonForConditionalGeneration": _HfExamplesInfo("facebook/chameleon-7b"), # noqa: E501
230 "ChatGLMModel": _HfExamplesInfo("THUDM/glm-4v-9b",
tests/multimodal/test_processing.py
+69
@@ -1,11 +1,13 @@
1 # SPDX-License-Identifier: Apache-2.0
2
3 from contextlib import nullcontext
4 +from types import MethodType
5 from typing import cast
6 from unittest.mock import MagicMock
7
8 import numpy as np
9 import pytest
10 +from transformers import ProcessorMixin
11
12 from vllm.config import ModelConfig
13 from vllm.multimodal import MULTIMODAL_REGISTRY
@@ -636,3 +638,70 @@ def test_limit_mm_per_prompt_apply(model_id, num_images, limit, is_valid):
638 mm_data=mm_data,
639 hf_processor_mm_kwargs={},
640 )
641 +
642 +
643 +class _ProcessorProxy:
644 +
645 + def __init__(self, processor: ProcessorMixin) -> None:
646 + super().__init__()
647 +
648 + self.__processor = processor
649 +
650 + def __getattr__(self, key: str):
651 + return getattr(self.__processor, key)
652 +
653 + def __call__(
654 + self,
655 + text=None,
656 + images=None,
657 + videos=None,
658 + exists=None,
659 + return_tensors=None,
660 + ):
661 + return dict(exists=exists)
662 +
663 +
664 +@pytest.mark.parametrize("model_id", ["Qwen/Qwen2-VL-7B-Instruct"]) # Dummy
665 +# yapf: disable
666 +@pytest.mark.parametrize(
667 + ("call_kwargs", "expected_kwargs"),
668 + [
669 + # Should ignore invalid kwargs
670 + ({"does_not_exist": 100}, {"exists": None}),
671 + ({"exists": 1}, {"exists": 1}),
672 + ({"does_not_exist": 100, "exists": 1}, {"exists": 1}),
673 + ],
674 +)
675 +# yapf: enable
676 +def test_hf_processor_kwargs(model_id, call_kwargs, expected_kwargs):
677 + model_config = ModelConfig(
678 + model=model_id,
679 + task="auto",
680 + tokenizer=model_id,
681 + tokenizer_mode="auto",
682 + trust_remote_code=False,
683 + seed=0,
684 + dtype="half",
685 + revision=None,
686 + )
687 +
688 + processor = MULTIMODAL_REGISTRY.create_processor(
689 + model_config,
690 + tokenizer=cached_get_tokenizer(model_config.tokenizer),
691 + )
692 + orig_get_hf_processor = processor.info.get_hf_processor
693 +
694 + def get_hf_processor(self, **kwargs):
695 + assert kwargs == call_kwargs
696 + return _ProcessorProxy(orig_get_hf_processor())
697 +
698 + processor.info.get_hf_processor = MethodType(get_hf_processor,
699 + processor.info)
700 +
701 + out_kwargs = processor._call_hf_processor(
702 + prompt="",
703 + mm_data={},
704 + mm_kwargs=call_kwargs,
705 + )
706 +
707 + assert out_kwargs == expected_kwargs
tests/multimodal/test_processor_kwargs.py deleted
-402
@@ -1,402 +0,0 @@
1 -# SPDX-License-Identifier: Apache-2.0
2 -
3 -from array import array
4 -from typing import Callable, Dict, Mapping, Optional
5 -from unittest.mock import patch
6 -
7 -import pytest
8 -import torch
9 -
10 -from vllm.inputs import (DecoderOnlyInputs, DummyData, InputContext,
11 - InputRegistry, ProcessorInputs, token_inputs)
12 -from vllm.multimodal import MultiModalRegistry
13 -from vllm.sequence import VLLM_TOKEN_ID_ARRAY_TYPE, SequenceData
14 -
15 -from ..models.utils import build_model_context
16 -
17 -# Used for fast tests where the model doesn't matter
18 -DUMMY_MODEL_ID = "facebook/opt-125m"
19 -# Used for tests that need a multimodal model
20 -MULTIMODAL_MODEL_ID = "OpenGVLab/InternVL2-2B"
21 -
22 -# For mm_processor_kwargs - we test overrides by defining mocks for each place
23 -# it is used, and ensuring that we can pass processor kwargs an override value
24 -# to receive the intended result for things like sequence length etc.
25 -DEFAULT_MAX_DYNAMIC_PATCH = 6
26 -MAX_DYNAMIC_PATCH_OVERRIDE = 4
27 -
28 -
29 -# Mocks for all of the places that we use the mm_processor_kwargs
30 -# to override values in different callables
31 -@pytest.fixture
32 -def use_processor_mock():
33 - """Patches the internal model input processor with an override callable."""
34 -
35 - def custom_processor(ctx: InputContext,
36 - inputs: DecoderOnlyInputs,
37 - *,
38 - max_dynamic_patch=DEFAULT_MAX_DYNAMIC_PATCH):
39 - # For testing purposes, we don't worry about the prompt
40 - return token_inputs(
41 - prompt_token_ids=[],
42 - mm_processor_kwargs={"max_dynamic_patch": max_dynamic_patch})
43 -
44 - with patch("vllm.inputs.registry.InputRegistry._get_model_input_processor",
45 - return_value=custom_processor):
46 - yield
47 -
48 -
49 -@pytest.fixture
50 -def use_dummy_data_mock():
51 - """Patches the internal model input processor with an override callable."""
52 -
53 - def custom_dummy_data_factory(self,
54 - ctx: InputContext,
55 - seq_len: int,
56 - mm_counts: Mapping[str, int],
57 - *,
58 - max_dynamic_patch=DEFAULT_MAX_DYNAMIC_PATCH):
59 - seq_data = SequenceData(
60 - array(VLLM_TOKEN_ID_ARRAY_TYPE, [0] * max_dynamic_patch))
61 - return DummyData(seq_data, None)
62 -
63 - with patch(
64 - "vllm.inputs.registry.InputRegistry._default_dummy_data_factory",
65 - custom_dummy_data_factory):
66 - yield
67 -
68 -
69 -# Lazy import to avoid CUDA reinitialization error
70 -def mm_model_cls():
71 - from vllm.model_executor.models.internvl import InternVLChatModel
72 -
73 - return InternVLChatModel
74 -
75 -
76 -# lambda whose signature matches max token calcs extra & mapper + extra kwargs
77 -get_max_dynamic_patch = lambda ctx, *, max_dynamic_patch=DEFAULT_MAX_DYNAMIC_PATCH: max_dynamic_patch # noqa: E501
78 -custom_mapper = lambda ctx, data, *, max_dynamic_patch=DEFAULT_MAX_DYNAMIC_PATCH: { # noqa: E501
79 - "pixel_values": torch.zeros(size=(1, max_dynamic_patch + 1, 3, 448, 448))
80 -}
81 -
82 -
83 -### Tests for default processor logic & mm_processor_kwargs wrapping
84 -def test_default_processor_is_a_noop():
85 - """Ensure that by default, there is no processor override."""
86 - dummy_registry = InputRegistry()
87 - ctx = build_model_context(DUMMY_MODEL_ID)
88 - processor = dummy_registry.create_input_processor(ctx.model_config)
89 - proc_inputs = token_inputs(prompt_token_ids=[], prompt="")
90 - proc_outputs = processor(inputs=proc_inputs)
91 - assert proc_inputs is proc_outputs
92 -
93 -
94 -def _get_max_dynamic_patch_info(init_max_dynamic_patch: int,
95 - inference_max_dynamic_patch: int):
96 - """Get the init / inference kwargs and expected max_dynamic_patch."""
97 - # If we have a value for max_dynamic_patch, pass the override value and make
98 - # sure we get that value as a return-value from out mock processor,
99 - # otherwise fall back to the default value
100 - init_kwargs = None if init_max_dynamic_patch is None else {
101 - "max_dynamic_patch": init_max_dynamic_patch
102 - }
103 - inference_kwargs = None if inference_max_dynamic_patch is None else {
104 - "max_dynamic_patch": inference_max_dynamic_patch
105 - }
106 - if inference_max_dynamic_patch is not None:
107 - expected_seq_count = inference_max_dynamic_patch
108 - elif init_max_dynamic_patch is not None:
109 - expected_seq_count = init_max_dynamic_patch
110 - else:
111 - expected_seq_count = DEFAULT_MAX_DYNAMIC_PATCH
112 - return init_kwargs, inference_kwargs, expected_seq_count
113 -
114 -
115 -def _get_processed_max_dynamic_patch(
116 - processor: Callable[[ProcessorInputs], ProcessorInputs],
117 - inference_kwargs: Optional[Dict[str, int]],
118 -) -> int:
119 - processed_inputs = processor(
120 - token_inputs(prompt_token_ids=[],
121 - prompt="",
122 - mm_processor_kwargs=inference_kwargs))
123 -
124 - assert "type" in processed_inputs
125 - assert processed_inputs["type"] == "token"
126 - assert "mm_processor_kwargs" in processed_inputs
127 - return processed_inputs["mm_processor_kwargs"]["max_dynamic_patch"]
128 -
129 -
130 -@pytest.mark.parametrize(
131 - "init_max_dynamic_patch,inference_max_dynamic_patch", [
132 - (None, None),
133 - (MAX_DYNAMIC_PATCH_OVERRIDE, None),
134 - (DEFAULT_MAX_DYNAMIC_PATCH, MAX_DYNAMIC_PATCH_OVERRIDE),
135 - ])
136 -def test_input_processor_kwargs(use_processor_mock, init_max_dynamic_patch,
137 - inference_max_dynamic_patch):
138 - """Ensure input processors can use processor kwargs."""
139 - dummy_registry = InputRegistry()
140 -
141 - (init_kwargs, inference_kwargs,
142 - expected_seq_count) = _get_max_dynamic_patch_info(
143 - init_max_dynamic_patch, inference_max_dynamic_patch)
144 -
145 - ctx = build_model_context(DUMMY_MODEL_ID, mm_processor_kwargs=init_kwargs)
146 - processor = dummy_registry.create_input_processor(ctx.model_config)
147 - max_dynamic_patch_val = _get_processed_max_dynamic_patch(
148 - processor, inference_kwargs)
149 -
150 - assert max_dynamic_patch_val == expected_seq_count
151 -
152 -
153 -@pytest.mark.parametrize(
154 - "mm_processor_kwargs",
155 - [
156 - # Not part of the signature
157 - {
158 - "does_not_exist": 100
159 - },
160 - # Part of the signature, not keyword only
161 - {
162 - "ctx": "something bad"
163 - }
164 - ])
165 -def test_processor_with_sad_kwarg_overrides(use_processor_mock,
166 - mm_processor_kwargs):
167 - """Ensure that input processors filter out invalid mm_processor_kwargs"""
168 - dummy_registry = InputRegistry()
169 - # Should filter out the init time kwargs
170 - ctx = build_model_context(DUMMY_MODEL_ID,
171 - mm_processor_kwargs=mm_processor_kwargs)
172 -
173 - processor = dummy_registry.create_input_processor(ctx.model_config)
174 - # Should filter out the inference time kwargs
175 - max_dynamic_patch_val = _get_processed_max_dynamic_patch(
176 - processor, mm_processor_kwargs)
177 - assert max_dynamic_patch_val == DEFAULT_MAX_DYNAMIC_PATCH
178 -
179 -
180 -### Test overrides for the dummy data
181 -@pytest.mark.parametrize("max_dynamic_patch",
182 - [None, MAX_DYNAMIC_PATCH_OVERRIDE])
183 -def test_dummy_data_kwarg_overrides(use_dummy_data_mock, max_dynamic_patch):
184 - """Ensure dummy data factories can use processor kwargs."""
185 - mm_processor_kwargs = None if max_dynamic_patch is None else {
186 - "max_dynamic_patch": max_dynamic_patch
187 - }
188 - expected_seq_count = (DEFAULT_MAX_DYNAMIC_PATCH
189 - if max_dynamic_patch is None else max_dynamic_patch)
190 - dummy_registry = InputRegistry()
191 - ctx = build_model_context(DUMMY_MODEL_ID,
192 - mm_processor_kwargs=mm_processor_kwargs)
193 - mm_registry = MultiModalRegistry()
194 - mm_registry.init_mm_limits_per_prompt(ctx.model_config)
195 -
196 - # NOTE: seq_len is thrown away here since this will leverage the
197 - # default dummy data factory that we have patched in, whose seq
198 - # len is solely dependent on the value of the mm_processor_kwargs.
199 - dummy_data = dummy_registry.dummy_data_for_profiling(
200 - ctx.model_config, seq_len=-1, mm_registry=mm_registry)
201 - assert len(dummy_data.seq_data.prompt_token_ids) == expected_seq_count
202 -
203 -
204 -@pytest.mark.parametrize(
205 - "mm_processor_kwargs",
206 - [
207 - # Not part of the signature
208 - {
209 - "does_not_exist": 100
210 - },
211 - # Part of the signature, not keyword only
212 - {
213 - "ctx": "something bad"
214 - }
215 - ])
216 -def test_dummy_data_with_sad_kwarg_overrides(use_dummy_data_mock,
217 - mm_processor_kwargs):
218 - """Ensure the dummy data factory filters out invalid mm_processor_kwargs"""
219 - dummy_registry = InputRegistry()
220 - ctx = build_model_context(DUMMY_MODEL_ID,
221 - mm_processor_kwargs=mm_processor_kwargs)
222 - mm_registry = MultiModalRegistry()
223 - mm_registry.init_mm_limits_per_prompt(ctx.model_config)
224 -
225 - # NOTE: seq_len is thrown away here since this will leverage the
226 - # default dummy data factory that we have patched in, whose seq
227 - # len is solely dependent on the value of the mm_processor_kwargs.
228 - dummy_data = dummy_registry.dummy_data_for_profiling(
229 - ctx.model_config, seq_len=-1, mm_registry=mm_registry)
230 - assert len(
231 - dummy_data.seq_data.prompt_token_ids) == DEFAULT_MAX_DYNAMIC_PATCH
232 -
233 -
234 -### Test overrides for the max token count per multimodal instance
235 -@pytest.mark.parametrize("max_dynamic_patch",
236 - [None, MAX_DYNAMIC_PATCH_OVERRIDE])
237 -def test_max_tokens_kwarg_overrides(max_dynamic_patch):
238 - """Ensure max token calcs can use processor kwargs."""
239 - mm_processor_kwargs = None if max_dynamic_patch is None else {
240 - "max_dynamic_patch": max_dynamic_patch
241 - }
242 - expected_seq_count = (DEFAULT_MAX_DYNAMIC_PATCH
243 - if max_dynamic_patch is None else max_dynamic_patch)
244 -
245 - ctx = build_model_context(MULTIMODAL_MODEL_ID,
246 - task="generate",
247 - trust_remote_code=True,
248 - mm_processor_kwargs=mm_processor_kwargs,
249 - limit_mm_per_prompt={"image": 1})
250 -
251 - mm_registry = MultiModalRegistry()
252 - mm_registry.init_mm_limits_per_prompt(ctx.model_config)
253 - # Patch the image registry for phi3v with our lambda that is compatible
254 - # with overrides, then ensure that calling the method correctly echos
255 - # our max_dynamic_patch value back from the mm_processor_kwargs.
256 - with patch.object(
257 - mm_registry._get_plugin("image"),
258 - "_max_mm_tokens",
259 - {mm_model_cls(): get_max_dynamic_patch},
260 - ):
261 - max_multimodal_tokens = mm_registry.get_max_multimodal_tokens(
262 - ctx.model_config)
263 -
264 - assert expected_seq_count == max_multimodal_tokens
265 -
266 -
267 -@pytest.mark.parametrize(
268 - "mm_processor_kwargs",
269 - [
270 - # Not part of the signature
271 - {
272 - "does_not_exist": 100
273 - },
274 - # Part of the signature, not keyword only
275 - {
276 - "ctx": "something bad"
277 - }
278 - ])
279 -def test_max_tokens_with_sad_kwarg_overrides(mm_processor_kwargs):
280 - """Ensure that max token calcs filters out invalid mm_processor_kwargs"""
281 - ctx = build_model_context(MULTIMODAL_MODEL_ID,
282 - task="generate",
283 - trust_remote_code=True,
284 - mm_processor_kwargs=mm_processor_kwargs,
285 - limit_mm_per_prompt={"image": 1})
286 -
287 - mm_registry = MultiModalRegistry()
288 - mm_registry.init_mm_limits_per_prompt(ctx.model_config)
289 -
290 - # Similar before, but since these kwargs get filtered,
291 - # we always get our default value back.
292 - with patch.object(
293 - mm_registry._get_plugin("image"),
294 - "_max_mm_tokens",
295 - {mm_model_cls(): get_max_dynamic_patch},
296 - ):
297 - max_multimodal_tokens = mm_registry.get_max_multimodal_tokens(
298 - ctx.model_config)
299 -
300 - assert max_multimodal_tokens == DEFAULT_MAX_DYNAMIC_PATCH
301 -
302 -
303 -### Test overrides for the mapper
304 -@pytest.mark.parametrize(
305 - "max_dynamic_patch",
306 - [DEFAULT_MAX_DYNAMIC_PATCH, MAX_DYNAMIC_PATCH_OVERRIDE])
307 -def test_default_mapper_with_processor_kwargs(image_assets, max_dynamic_patch):
308 - """Ensure that the mapper processor kwargs can fall back to HF models."""
309 - # NOTE - we don't validate bad inputs for the default mapper, because it's
310 - # through the automodel interface in transformers, so we can't easily
311 - # inspect what kwargs are or are not allowed.
312 - ctx = build_model_context(
313 - MULTIMODAL_MODEL_ID,
314 - task="generate",
315 - trust_remote_code=True,
316 - mm_processor_kwargs={"max_dynamic_patch": max_dynamic_patch},
317 - limit_mm_per_prompt={"image": 1})
318 -
319 - mm_registry = MultiModalRegistry()
320 - mm_registry.init_mm_limits_per_prompt(ctx.model_config)
321 -
322 - image = image_assets[0].pil_image
323 - mm_inputs = {"image": image}
324 -
325 - mapped_inputs = mm_registry.map_input(ctx.model_config, mm_inputs)
326 - # pixel vals should have shape: [batch, max_dynamic_patch+1, ...]
327 - assert mapped_inputs["pixel_values"].shape[1] == max_dynamic_patch + 1
328 -
329 -
330 -@pytest.mark.parametrize(
331 - "init_max_dynamic_patch,inference_max_dynamic_patch", [
332 - (None, None),
333 - (MAX_DYNAMIC_PATCH_OVERRIDE, None),
334 - (DEFAULT_MAX_DYNAMIC_PATCH, MAX_DYNAMIC_PATCH_OVERRIDE),
335 - ])
336 -def test_custom_mapper_kwarg_overrides(image_assets, init_max_dynamic_patch,
337 - inference_max_dynamic_patch):
338 - """Ensure custom mappers can use processor kwargs."""
339 - (init_kwargs, inference_kwargs,
340 - expected_seq_count) = _get_max_dynamic_patch_info(
341 - init_max_dynamic_patch, inference_max_dynamic_patch)
342 -
343 - ctx = build_model_context(MULTIMODAL_MODEL_ID,
344 - task="generate",
345 - trust_remote_code=True,
346 - mm_processor_kwargs=init_kwargs,
347 - limit_mm_per_prompt={"image": 1})
348 -
349 - mm_registry = MultiModalRegistry()
350 - mm_registry.init_mm_limits_per_prompt(ctx.model_config)
351 - image = image_assets[0].pil_image
352 - mm_inputs = {"image": image}
353 -
354 - # Patch the image registry for phi3v with our lambda that is compatible
355 - # with overrides, then ensure that calling the method correctly echos
356 - # our max_dynamic_patch value back from the mm_processor_kwargs.
357 - mm_registry._get_plugin("image").register_input_mapper(custom_mapper)(
358 - mm_model_cls())
359 - mapped_inputs = mm_registry.map_input(ctx.model_config, mm_inputs,
360 - inference_kwargs)
361 -
362 - assert mapped_inputs["pixel_values"].shape[1] == expected_seq_count + 1
363 -
364 -
365 -@pytest.mark.parametrize(
366 - "mm_processor_kwargs",
367 - [
368 - # Not part of the signature
369 - {
370 - "does_not_exist": 100
371 - },
372 - # Part of the signature, not keyword only
373 - {
374 - "ctx": "something bad"
375 - }
376 - ])
377 -def test_custom_mapper_with_sad_kwarg_overrides(image_assets,
378 - mm_processor_kwargs):
379 - """Ensure that custom mappers filters out invalid mm_processor_kwargs"""
380 - # Should filter out the init time kwargs
381 - ctx = build_model_context(MULTIMODAL_MODEL_ID,
382 - task="generate",
383 - trust_remote_code=True,
384 - mm_processor_kwargs=mm_processor_kwargs,
385 - limit_mm_per_prompt={"image": 1})
386 -
387 - mm_registry = MultiModalRegistry()
388 - mm_registry.init_mm_limits_per_prompt(ctx.model_config)
389 - image = image_assets[0].pil_image
390 - mm_inputs = {"image": image}
391 -
392 - # Patch the image registry for phi3v with our lambda that is compatible
393 - # with overrides, then ensure that calling the method correctly echos
394 - # our max_dynamic_patch value back from the mm_processor_kwargs.
395 - mm_registry._get_plugin("image").register_input_mapper(custom_mapper)(
396 - mm_model_cls())
397 - # Should filter out the inference time kwargs
398 - mapped_inputs = mm_registry.map_input(
399 - ctx.model_config, mm_inputs, mm_processor_kwargs=mm_processor_kwargs)
400 -
401 - assert mapped_inputs["pixel_values"].shape[1] == (
402 - DEFAULT_MAX_DYNAMIC_PATCH + 1)