diff --git a/tests/models/utils.py b/tests/models/utils.py index ed1625d8d591a..8e3a86f426d5d 100644 --- a/tests/models/utils.py +++ b/tests/models/utils.py @@ -483,7 +483,11 @@ def dummy_hf_overrides( "num_kv_shared_layers": 1, } - model_arch_config = ModelConfig.get_model_arch_config(hf_config, text_config) + class DummyConfig: + hf_config = hf_config + hf_text_config = text_config + + model_arch_config = ModelConfig.get_model_arch_config(DummyConfig) # Only set MoE related config when the model has MoE layers. # Otherwise all models detected as MoE by _get_transformers_backend_cls. if model_arch_config.num_experts > 0: diff --git a/vllm/config/model.py b/vllm/config/model.py index 2062377d34640..dfe191199f1a9 100644 --- a/vllm/config/model.py +++ b/vllm/config/model.py @@ -484,9 +484,7 @@ class ModelConfig: self.hf_image_processor_config = get_hf_image_processor_config( self.model, hf_token=self.hf_token, revision=self.revision ) - self.model_arch_config = self.get_model_arch_config( - self.hf_config, self.hf_text_config - ) + self.model_arch_config = self.get_model_arch_config() architectures = self.architectures registry = self.registry @@ -604,14 +602,13 @@ class ModelConfig: self._verify_cuda_graph() self._verify_bnb_config() - @classmethod def get_model_arch_config( - cls, hf_config, hf_text_config + self, ) -> ModelArchitectureConfig: convertor_cls = MODEL_ARCH_CONFIG_CONVERTORS.get( - hf_config.model_type, ModelArchConfigConvertorBase + self.hf_config.model_type, ModelArchConfigConvertorBase ) - convertor = convertor_cls(hf_config, hf_text_config) + convertor = convertor_cls(self.hf_config, self.hf_text_config) return convertor.convert() @field_validator("tokenizer", "max_model_len", mode="wrap")