Skip to content

Commit 049c245

Browse files
authored
[Misc] Replace flaky image urls in pixtral test (#22574)
Signed-off-by: Isotr0py <[email protected]> Signed-off-by: Isotr0py <[email protected]>
1 parent 00976db commit 049c245

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

tests/models/multimodal/generation/test_pixtral.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from vllm.sequence import Logprob, SampleLogprobs
1919

2020
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
2222

2323
if TYPE_CHECKING:
2424
from _typeshed import StrPath
@@ -29,10 +29,10 @@
2929
MODELS = [PIXTRAL_ID, MISTRAL_SMALL_3_1_ID]
3030

3131
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",
3636
]
3737
PROMPT = "Describe each image in one short sentence."
3838

@@ -110,11 +110,6 @@ def _create_engine_inputs_hf(urls: list[str]) -> TextPrompt:
110110
_create_msg_format(IMG_URLS[:2]),
111111
_create_msg_format(IMG_URLS),
112112
]
113-
ENGINE_INPUTS = [
114-
_create_engine_inputs(IMG_URLS[:1]),
115-
_create_engine_inputs(IMG_URLS[:2]),
116-
_create_engine_inputs(IMG_URLS),
117-
]
118113

119114
SAMPLING_PARAMS = SamplingParams(max_tokens=512, temperature=0.0, logprobs=5)
120115
LIMIT_MM_PER_PROMPT = dict(image=4)
@@ -195,7 +190,6 @@ def test_chat(
195190
name_1="output")
196191

197192

198-
@large_gpu_test(min_gb=48)
199193
@pytest.mark.parametrize("prompt,expected_ranges",
200194
[(_create_engine_inputs_hf(IMG_URLS[:1]),
201195
[PlaceholderRange(offset=11, length=494)]),
@@ -204,7 +198,7 @@ def test_chat(
204198
PlaceholderRange(offset=277, length=1056),
205199
PlaceholderRange(offset=1333, length=418)
206200
])])
207-
def test_multi_modal_placeholders(vllm_runner, prompt,
201+
def test_multi_modal_placeholders(vllm_runner, prompt: TextPrompt,
208202
expected_ranges: list[PlaceholderRange],
209203
monkeypatch) -> None:
210204

@@ -215,6 +209,8 @@ def test_multi_modal_placeholders(vllm_runner, prompt,
215209
"mistral-community/pixtral-12b",
216210
max_model_len=8192,
217211
limit_mm_per_prompt=LIMIT_MM_PER_PROMPT,
212+
load_format="dummy",
213+
hf_overrides=dummy_hf_overrides,
218214
) as vllm_model:
219215
outputs = vllm_model.llm.generate(prompt)
220216

@@ -230,5 +226,7 @@ def test_multi_modal_placeholders(vllm_runner, prompt,
230226
expected_ranges), f"{image_placeholder_ranges=}"
231227
for real_range, expected_range in zip(image_placeholder_ranges,
232228
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, \
234232
f"{real_range=} {expected_range=}"

tests/models/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@ class RerankModelInfo(NamedTuple):
357357

358358
def dummy_hf_overrides(
359359
hf_config: PretrainedConfig,
360-
model_arch: str,
360+
*,
361+
model_arch: str = "",
361362
exist_overrides: Optional[dict[str, Any]] = None,
362363
) -> PretrainedConfig:
363364
"""

0 commit comments

Comments
 (0)