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 11, 05:00 UTC
Check for truthy `rope_parameters` not the existence of it (#30983)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Harry Mellor committed
Dec 18, 2025 at 21:59 UTC
19c583398aec0ef2b9fe42ba020bc3c39e7e001f
1 file changed
+5
-5
vllm/transformers_utils/config.py
+5
-5
@@ -318,15 +318,15 @@ def patch_rope_parameters(config: PretrainedConfig) -> None:
318
# Transformers v4 installed, legacy config fields may be present
319
if (rope_scaling := getattr(config, "rope_scaling", None)) is not None:
320
config.rope_parameters = rope_scaling
321
+ if (
322
+ rope_theta is not None or partial_rotary_factor is not None
323
+ ) and not getattr(config, "rope_parameters", None):
324
+ config.rope_parameters = {"rope_type": "default"}
325
if rope_theta is not None:
322
- if not hasattr(config, "rope_parameters"):
323
- config.rope_parameters = {"rope_type": "default"}
326
config.rope_parameters["rope_theta"] = rope_theta
327
if partial_rotary_factor is not None:
326
- if not hasattr(config, "rope_parameters"):
327
- config.rope_parameters = {"rope_type": "default"}
328
config.rope_parameters["partial_rotary_factor"] = partial_rotary_factor
329
- elif rope_theta is not None or hasattr(config, "rope_parameters"):
329
+ elif rope_theta is not None or getattr(config, "rope_parameters", None):
330
# Transformers v5 installed
331
# Patch these fields in case they used non-standard names
332
if rope_theta is not None: