Fix Laguna patch mutating flat RoPE parameters (#57189)

Signed-off-by: Laura López Real <laulopezreal@users.noreply.github.com>
Co-authored-by: Laura López Real <laulopezreal@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Laura Lopez-Real
2026-09-17 12:22:57 +00:00
committed by GitHub
co-authored by Laura López Real mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 91a4c40b45
commit a85dd55177
2 changed files with 38 additions and 1 deletions
+1 -1
View File
@@ -273,7 +273,7 @@ def _patch_hf_transformers_nested_rope_validation() -> None:
layer_types = set(rope_parameters) & set(
hf_configuration_utils.ALLOWED_LAYER_TYPES
)
if shared_keys := set(rope_parameters) - layer_types:
if layer_types and (shared_keys := set(rope_parameters) - layer_types):
for key in shared_keys:
del rope_parameters[key]
logger.warning(