[Bugfix][Model] Fix crash loading Mamba/Mamba2 checkpoints without an architectures field (#46037)
Signed-off-by: Ting Sun <suntcrick@gmail.com> Signed-off-by: Ting SUN <suntcrick@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Wentao Ye
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
b6cc46ec3b
commit
fb2faceacd
@@ -1936,12 +1936,21 @@ class VllmConfig:
|
|||||||
if architecture is None:
|
if architecture is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
from vllm.model_executor.models import ModelRegistry
|
||||||
from vllm.model_executor.models.config import (
|
from vllm.model_executor.models.config import (
|
||||||
MODELS_CONFIG_MAP,
|
MODELS_CONFIG_MAP,
|
||||||
HybridAttentionMambaModelConfig,
|
HybridAttentionMambaModelConfig,
|
||||||
)
|
)
|
||||||
|
|
||||||
cls = MODELS_CONFIG_MAP.get(architecture, None)
|
cls = MODELS_CONFIG_MAP.get(architecture, None)
|
||||||
|
if cls is None:
|
||||||
|
# `architecture` may be an HF base-model name (e.g. "Mamba2Model"
|
||||||
|
# when `architectures` is omitted); normalize to the resolved arch
|
||||||
|
# so per-arch config hooks are not skipped.
|
||||||
|
architecture = ModelRegistry._normalize_arch(
|
||||||
|
architecture, self.model_config
|
||||||
|
)
|
||||||
|
cls = MODELS_CONFIG_MAP.get(architecture, None)
|
||||||
if cls is not None:
|
if cls is not None:
|
||||||
cls.verify_and_update_config(self)
|
cls.verify_and_update_config(self)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user