Fix OlmoHybridForCausalLM not initialising (#43846)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-05-28 05:33:31 -07:00
committed by GitHub
co-authored by mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 811d805195
commit 19af4e6dd4
+2 -2
View File
@@ -430,9 +430,9 @@ def patch_legacy_rope_type(rope_parameters: dict[str, Any] | None) -> None:
if "rope_type" not in rope_parameters and "type" in rope_parameters:
rope_parameters["rope_type"] = rope_parameters["type"]
logger.info("Replacing legacy 'type' key with 'rope_type'")
# Case 3: No rope_type field at all - cannot determine RoPE type, raise error
# Case 3: No rope_type field present - nothing to patch
if "rope_type" not in rope_parameters:
raise ValueError("rope_parameters should have a 'rope_type' key")
return
# Patch legacy rope_type values with warning
if rope_parameters["rope_type"] == "su":
rope_parameters["rope_type"] = "longrope"