mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-06-05 21:42:19 +08:00
align with_hf_config
Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
This commit is contained in:
parent
ec81168330
commit
9b19e3b94f
@ -508,12 +508,7 @@ class ModelConfig:
|
|||||||
self.hf_image_processor_config = get_hf_image_processor_config(
|
self.hf_image_processor_config = get_hf_image_processor_config(
|
||||||
self.model, hf_token=self.hf_token, revision=self.revision
|
self.model, hf_token=self.hf_token, revision=self.revision
|
||||||
)
|
)
|
||||||
self.model_arch_config = None
|
self.model_arch_config = self.get_model_arch_config()
|
||||||
convertor_cls = MODEL_ARCH_CONFIG_CONVERTORS.get(
|
|
||||||
hf_config.model_type, ModelArchConfigConvertorBase
|
|
||||||
)
|
|
||||||
convertor = convertor_cls(hf_config)
|
|
||||||
self.model_arch_config = convertor.convert(self.model, self.revision)
|
|
||||||
|
|
||||||
architectures = self.architectures
|
architectures = self.architectures
|
||||||
registry = self.registry
|
registry = self.registry
|
||||||
@ -717,6 +712,13 @@ class ModelConfig:
|
|||||||
self._verify_cuda_graph()
|
self._verify_cuda_graph()
|
||||||
self._verify_bnb_config()
|
self._verify_bnb_config()
|
||||||
|
|
||||||
|
def get_model_arch_config(self) -> ModelArchitectureConfig:
|
||||||
|
convertor_cls = MODEL_ARCH_CONFIG_CONVERTORS.get(
|
||||||
|
self.hf_config.model_type, ModelArchConfigConvertorBase
|
||||||
|
)
|
||||||
|
convertor = convertor_cls(self.hf_config)
|
||||||
|
return convertor.convert(self.model, self.revision)
|
||||||
|
|
||||||
@field_validator("tokenizer_mode", mode="after")
|
@field_validator("tokenizer_mode", mode="after")
|
||||||
def _lowercase_tokenizer_mode(cls, tokenizer_mode: str) -> str:
|
def _lowercase_tokenizer_mode(cls, tokenizer_mode: str) -> str:
|
||||||
return tokenizer_mode.lower()
|
return tokenizer_mode.lower()
|
||||||
|
|||||||
@ -421,6 +421,7 @@ class VllmConfig:
|
|||||||
|
|
||||||
model_config = copy.deepcopy(self.model_config)
|
model_config = copy.deepcopy(self.model_config)
|
||||||
model_config.hf_config = hf_config
|
model_config.hf_config = hf_config
|
||||||
|
model_config.model_arch_config = model_config.get_model_arch_config()
|
||||||
|
|
||||||
return replace(self, model_config=model_config)
|
return replace(self, model_config=model_config)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user