mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-18 01:25:01 +08:00
[Bugfix] Fix: add patch_rope_scaling after hf override (#20857)
Signed-off-by: Wang Siyuan <wsy0227@sjtu.edu.cn> Signed-off-by: Wang Siyuan <sywang0227@gmail.com>
This commit is contained in:
parent
bd4c1e6fdb
commit
247102f07f
@ -532,16 +532,12 @@ class ModelConfig:
|
|||||||
self.config_format = ConfigFormat(self.config_format)
|
self.config_format = ConfigFormat(self.config_format)
|
||||||
|
|
||||||
hf_config = get_config(self.hf_config_path or self.model,
|
hf_config = get_config(self.hf_config_path or self.model,
|
||||||
self.trust_remote_code, self.revision,
|
self.trust_remote_code,
|
||||||
self.code_revision, self.config_format)
|
self.revision,
|
||||||
|
self.code_revision,
|
||||||
if hf_overrides_kw:
|
self.config_format,
|
||||||
logger.debug("Overriding HF config with %s", hf_overrides_kw)
|
hf_overrides_kw=hf_overrides_kw,
|
||||||
hf_config.update(hf_overrides_kw)
|
hf_overrides_fn=hf_overrides_fn)
|
||||||
if hf_overrides_fn:
|
|
||||||
logger.debug("Overriding HF config with %s", hf_overrides_fn)
|
|
||||||
hf_config = hf_overrides_fn(hf_config)
|
|
||||||
|
|
||||||
self.hf_config = hf_config
|
self.hf_config = hf_config
|
||||||
|
|
||||||
self.hf_text_config = get_hf_text_config(self.hf_config)
|
self.hf_text_config = get_hf_text_config(self.hf_config)
|
||||||
|
|||||||
@ -305,6 +305,9 @@ def get_config(
|
|||||||
revision: Optional[str] = None,
|
revision: Optional[str] = None,
|
||||||
code_revision: Optional[str] = None,
|
code_revision: Optional[str] = None,
|
||||||
config_format: ConfigFormat = ConfigFormat.AUTO,
|
config_format: ConfigFormat = ConfigFormat.AUTO,
|
||||||
|
hf_overrides_kw: Optional[dict[str, Any]] = None,
|
||||||
|
hf_overrides_fn: Optional[Callable[[PretrainedConfig],
|
||||||
|
PretrainedConfig]] = None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> PretrainedConfig:
|
) -> PretrainedConfig:
|
||||||
# Separate model folder from file path for GGUF models
|
# Separate model folder from file path for GGUF models
|
||||||
@ -423,6 +426,13 @@ def get_config(
|
|||||||
model_type = MODEL_FOR_CAUSAL_LM_MAPPING_NAMES[config.model_type]
|
model_type = MODEL_FOR_CAUSAL_LM_MAPPING_NAMES[config.model_type]
|
||||||
config.update({"architectures": [model_type]})
|
config.update({"architectures": [model_type]})
|
||||||
|
|
||||||
|
if hf_overrides_kw:
|
||||||
|
logger.debug("Overriding HF config with %s", hf_overrides_kw)
|
||||||
|
config.update(hf_overrides_kw)
|
||||||
|
if hf_overrides_fn:
|
||||||
|
logger.debug("Overriding HF config with %s", hf_overrides_fn)
|
||||||
|
config = hf_overrides_fn(config)
|
||||||
|
|
||||||
patch_rope_scaling(config)
|
patch_rope_scaling(config)
|
||||||
|
|
||||||
if trust_remote_code:
|
if trust_remote_code:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user