mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-01-02 03:14:00 +08:00
Check for truthy rope_parameters not the existence of it (#30983)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
parent
b0b77c4655
commit
19c583398a
@ -318,15 +318,15 @@ def patch_rope_parameters(config: PretrainedConfig) -> None:
|
||||
# Transformers v4 installed, legacy config fields may be present
|
||||
if (rope_scaling := getattr(config, "rope_scaling", None)) is not None:
|
||||
config.rope_parameters = rope_scaling
|
||||
if (
|
||||
rope_theta is not None or partial_rotary_factor is not None
|
||||
) and not getattr(config, "rope_parameters", None):
|
||||
config.rope_parameters = {"rope_type": "default"}
|
||||
if rope_theta is not None:
|
||||
if not hasattr(config, "rope_parameters"):
|
||||
config.rope_parameters = {"rope_type": "default"}
|
||||
config.rope_parameters["rope_theta"] = rope_theta
|
||||
if partial_rotary_factor is not None:
|
||||
if not hasattr(config, "rope_parameters"):
|
||||
config.rope_parameters = {"rope_type": "default"}
|
||||
config.rope_parameters["partial_rotary_factor"] = partial_rotary_factor
|
||||
elif rope_theta is not None or hasattr(config, "rope_parameters"):
|
||||
elif rope_theta is not None or getattr(config, "rope_parameters", None):
|
||||
# Transformers v5 installed
|
||||
# Patch these fields in case they used non-standard names
|
||||
if rope_theta is not None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user