Skip to content

Commit c1d1b74

Browse files
committed
add verification for Omni
Signed-off-by: shen-shanshan <[email protected]>
1 parent 1da8bc7 commit c1d1b74

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

vllm_ascend/utils.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@
6060
_ENABLE_SP = None
6161
_HAS_LAYER_IDX = None
6262

63-
_MULTI_MODAL_MODEL_ARCH_KEY_WORDS = ["VL", "Omni"]
64-
6563

6664
def is_310p():
6765
global _IS_310P
@@ -718,13 +716,18 @@ def is_moe_model(vllm_config: VllmConfig):
718716
if _IS_MOE_MODEL is None:
719717
model_configs = vllm_config.model_config.hf_config.to_dict()
720718

721-
global _MULTI_MODAL_MODEL_ARCH_KEY_WORDS
722-
if (any(mm_arch in model_configs["architectures"][0]
723-
for mm_arch in _MULTI_MODAL_MODEL_ARCH_KEY_WORDS)
719+
if ("VL" in model_configs["architectures"][0]
724720
and "text_config" in model_configs):
725-
# Check multi-modal models
721+
# Check VL multi-modal models
726722
_IS_MOE_MODEL = any("experts" in key.lower()
727723
for key in model_configs["text_config"])
724+
elif ("Omni" in model_configs["architectures"][0]
725+
and "talker_config" in model_configs
726+
and "text_config" in model_configs["talker_config"]):
727+
# Check Omni multi-modal models
728+
_IS_MOE_MODEL = any(
729+
"experts" in key.lower()
730+
for key in model_configs["talker_config"]["text_config"])
728731
else:
729732
# Check text-only models
730733
_IS_MOE_MODEL = any("experts" in key.lower()

0 commit comments

Comments
 (0)