[MM][Bugfix] Minor fix for VL model verification (#4385)

### What this PR does / why we need it?

To fix ops test, where `model_config` has been set to `None` and doesn't
has `hf_config` attribute, we have added a check for `model_config` to
guarantee it is not `None_Type`.

cherry-pick from main:
https://github.com/vllm-project/vllm-ascend/pull/4384.


Signed-off-by: shen-shanshan <467638484@qq.com>
This commit is contained in:
Shanshan Shen
2025-11-25 20:36:32 +08:00
committed by GitHub
parent 386a85eccc
commit cdaf7f4a51

View File

@@ -700,7 +700,7 @@ def _is_contain_expert(config: Any):
def is_vl_model(vllm_config: VllmConfig):
"""Checks if the model is a VL model by config"""
global _IS_VL_MODEL
if _IS_VL_MODEL is None:
if _IS_VL_MODEL is None and vllm_config.model_config:
model_configs = vllm_config.model_config.hf_config.to_dict()
_IS_VL_MODEL = "VL" in model_configs["architectures"][0]
return _IS_VL_MODEL