Skip to content

Commit 6a39ba8

Browse files
authored
[Bugfix] Fix failing multimodal standard test (#22153)
Signed-off-by: Isotr0py <[email protected]>
1 parent d3c18c9 commit 6a39ba8

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

tests/models/multimodal/test_tensor_schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ def test_model_tensor_schema(model_arch: str, vllm_runner: type[VllmRunner],
105105

106106
model_info = HF_EXAMPLE_MODELS.get_hf_info(model_arch)
107107
model_info.check_available_online(on_fail="skip")
108+
model_info.check_transformers_version(on_fail="skip",
109+
check_max_version=False)
108110

109111
model_id = model_info.default
110112

tests/models/registry.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ def check_transformers_version(
8080
self,
8181
*,
8282
on_fail: Literal["error", "skip"],
83+
check_min_version: bool = True,
84+
check_max_version: bool = True,
8385
) -> None:
8486
"""
8587
If the installed transformers version does not meet the requirements,
@@ -96,9 +98,11 @@ def check_transformers_version(
9698
msg = f"`transformers=={current_version}` installed, but `transformers"
9799
# Only check the base version for the min/max version, otherwise preview
98100
# models cannot be run because `x.yy.0.dev0`<`x.yy.0`
99-
if min_version and Version(cur_base_version) < Version(min_version):
101+
if (check_min_version and min_version
102+
and Version(cur_base_version) < Version(min_version)):
100103
msg += f">={min_version}` is required to run this model."
101-
elif max_version and Version(cur_base_version) > Version(max_version):
104+
elif (check_max_version and max_version
105+
and Version(cur_base_version) > Version(max_version)):
102106
msg += f"<={max_version}` is required to run this model."
103107
else:
104108
return
@@ -185,6 +189,8 @@ def check_available_online(
185189
min_transformers_version="4.53"),
186190
"GlmForCausalLM": _HfExamplesInfo("THUDM/glm-4-9b-chat-hf"),
187191
"Glm4ForCausalLM": _HfExamplesInfo("THUDM/GLM-4-9B-0414"),
192+
"Glm4MoeForCausalLM": _HfExamplesInfo("zai-org/GLM-4.5",
193+
min_transformers_version="4.54"), # noqa: E501
188194
"GPT2LMHeadModel": _HfExamplesInfo("openai-community/gpt2",
189195
{"alias": "gpt2"}),
190196
"GPTBigCodeForCausalLM": _HfExamplesInfo("bigcode/starcoder",
@@ -378,8 +384,6 @@ def check_available_online(
378384
trust_remote_code=True,
379385
hf_overrides={"architectures": ["GLM4VForCausalLM"]}), # noqa: E501
380386
"Glm4vForConditionalGeneration": _HfExamplesInfo("THUDM/GLM-4.1V-9B-Thinking"), # noqa: E501
381-
"Glm4MoeForCausalLM": _HfExamplesInfo("zai-org/GLM-4.5",
382-
min_transformers_version="4.54"), # noqa: E501
383387
"Glm4v_moeForConditionalGeneration": _HfExamplesInfo("zai-org/GLM-4.5V-Air",
384388
is_available_online=False), # noqa: E501
385389
"H2OVLChatModel": _HfExamplesInfo("h2oai/h2ovl-mississippi-800m",

0 commit comments

Comments
 (0)