@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 049c245143
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 14, 05:30 UTC

[Misc] Replace flaky image urls in pixtral test (#22574)

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Signed-off-by: Isotr0py <2037008807@qq.com>

Isotr0py committed Aug 10, 2025 at 21:18 UTC 049c245143ef0f8fd338fc3200f51a18fc53b403
2 files changed +13 -14
tests/models/multimodal/generation/test_pixtral.py
+11 -13
@@ -18,7 +18,7 @@ from vllm.multimodal.inputs import PlaceholderRange
18 from vllm.sequence import Logprob, SampleLogprobs
19
20 from ....utils import VLLM_PATH, large_gpu_test
21 -from ...utils import check_logprobs_close
21 +from ...utils import check_logprobs_close, dummy_hf_overrides
22
23 if TYPE_CHECKING:
24 from _typeshed import StrPath
@@ -29,10 +29,10 @@ MISTRAL_SMALL_3_1_ID = "mistralai/Mistral-Small-3.1-24B-Instruct-2503"
29 MODELS = [PIXTRAL_ID, MISTRAL_SMALL_3_1_ID]
30
31 IMG_URLS = [
32 - "https://picsum.photos/id/237/400/300",
33 - "https://picsum.photos/id/231/200/300",
34 - "https://picsum.photos/id/27/500/500",
35 - "https://picsum.photos/id/17/150/600",
32 + "https://huggingface.co/datasets/Isotr0py/mistral-test-images/resolve/main/237-400x300.jpg",
33 + "https://huggingface.co/datasets/Isotr0py/mistral-test-images/resolve/main/231-200x300.jpg",
34 + "https://huggingface.co/datasets/Isotr0py/mistral-test-images/resolve/main/27-500x500.jpg",
35 + "https://huggingface.co/datasets/Isotr0py/mistral-test-images/resolve/main/17-150x600.jpg",
36 ]
37 PROMPT = "Describe each image in one short sentence."
38
@@ -110,11 +110,6 @@ MSGS = [
110 _create_msg_format(IMG_URLS[:2]),
111 _create_msg_format(IMG_URLS),
112 ]
113 -ENGINE_INPUTS = [
114 - _create_engine_inputs(IMG_URLS[:1]),
115 - _create_engine_inputs(IMG_URLS[:2]),
116 - _create_engine_inputs(IMG_URLS),
117 -]
113
114 SAMPLING_PARAMS = SamplingParams(max_tokens=512, temperature=0.0, logprobs=5)
115 LIMIT_MM_PER_PROMPT = dict(image=4)
@@ -195,7 +190,6 @@ def test_chat(
190 name_1="output")
191
192
198 -@large_gpu_test(min_gb=48)
193 @pytest.mark.parametrize("prompt,expected_ranges",
194 [(_create_engine_inputs_hf(IMG_URLS[:1]),
195 [PlaceholderRange(offset=11, length=494)]),
@@ -204,7 +198,7 @@ def test_chat(
198 PlaceholderRange(offset=277, length=1056),
199 PlaceholderRange(offset=1333, length=418)
200 ])])
207 -def test_multi_modal_placeholders(vllm_runner, prompt,
201 +def test_multi_modal_placeholders(vllm_runner, prompt: TextPrompt,
202 expected_ranges: list[PlaceholderRange],
203 monkeypatch) -> None:
204
@@ -215,6 +209,8 @@ def test_multi_modal_placeholders(vllm_runner, prompt,
209 "mistral-community/pixtral-12b",
210 max_model_len=8192,
211 limit_mm_per_prompt=LIMIT_MM_PER_PROMPT,
212 + load_format="dummy",
213 + hf_overrides=dummy_hf_overrides,
214 ) as vllm_model:
215 outputs = vllm_model.llm.generate(prompt)
216
@@ -230,5 +226,7 @@ def test_multi_modal_placeholders(vllm_runner, prompt,
226 expected_ranges), f"{image_placeholder_ranges=}"
227 for real_range, expected_range in zip(image_placeholder_ranges,
228 expected_ranges):
233 - assert real_range == expected_range, \
229 + assert real_range.offset == expected_range.offset, \
230 + f"{real_range=} {expected_range=}"
231 + assert real_range.length == expected_range.length, \
232 f"{real_range=} {expected_range=}"
tests/models/utils.py
+2 -1
@@ -357,7 +357,8 @@ class RerankModelInfo(NamedTuple):
357
358 def dummy_hf_overrides(
359 hf_config: PretrainedConfig,
360 - model_arch: str,
360 + *,
361 + model_arch: str = "",
362 exist_overrides: Optional[dict[str, Any]] = None,
363 ) -> PretrainedConfig:
364 """