A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 07:00 UTC
[Bugfix] Handle conflicts between modern and legacy fields (#10471)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
Nov 20, 2024 at 14:45 UTC
09dbf9ff16410d0f83adcc9705764ea1c7f5f017
1 file changed
+9
vllm/transformers_utils/config.py
+9
@@ -107,6 +107,15 @@ def patch_rope_scaling(config: PretrainedConfig) -> None:
107
108
109
def patch_rope_scaling_dict(rope_scaling: Dict[str, Any]) -> None:
110
+ if "rope_type" in rope_scaling and "type" in rope_scaling:
111
+ rope_type = rope_scaling["rope_type"]
112
+ rope_type_legacy = rope_scaling["type"]
113
+ if rope_type != rope_type_legacy:
114
+ raise ValueError(
115
+ f"Found conflicts between 'rope_type={rope_type}' (modern "
116
+ f"field) and 'type={rope_type_legacy}' (legacy field). "
117
+ "You should only specify one of them.")
118
+
119
if "rope_type" not in rope_scaling and "type" in rope_scaling:
120
rope_scaling["rope_type"] = rope_scaling["type"]
121
logger.info("Replacing legacy 'type' key with 'rope_type'")