Skip to content

Commit ce1d477

Browse files
committed
Change "default" rope scaling type back to "mrope" in HF config
1 parent a5b289c commit ce1d477

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

vllm/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ def _get_and_verify_max_len(
17401740
"with rope_scaling. Please raise an issue so we can "
17411741
"investigate.")
17421742

1743-
if rope_type in ("mrope", "default"):
1743+
if rope_type == "mrope":
17441744
scaling_factor = 1
17451745
else:
17461746
assert "factor" in rope_scaling

vllm/transformers_utils/config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ def get_config(
174174
else:
175175
raise e
176176

177+
# Replace unrecognized "default" rope scaling type with "mrope"
178+
# See https://github.com/huggingface/transformers/issues/33401
179+
hf_rope_scaling = getattr(config, "rope_scaling", None)
180+
if hf_rope_scaling is not None:
181+
for type_key in ("type", "rope_type"):
182+
if hf_rope_scaling.get(type_key) == "default":
183+
hf_rope_scaling[type_key] = "mrope"
184+
177185
elif config_format == ConfigFormat.MISTRAL:
178186
config = load_params_config(model, revision)
179187
else:

0 commit comments

Comments
 (0)