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:
co-authored by
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
811d805195
commit
19af4e6dd4
@@ -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:
|
if "rope_type" not in rope_parameters and "type" in rope_parameters:
|
||||||
rope_parameters["rope_type"] = rope_parameters["type"]
|
rope_parameters["rope_type"] = rope_parameters["type"]
|
||||||
logger.info("Replacing legacy 'type' key with 'rope_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:
|
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
|
# Patch legacy rope_type values with warning
|
||||||
if rope_parameters["rope_type"] == "su":
|
if rope_parameters["rope_type"] == "su":
|
||||||
rope_parameters["rope_type"] = "longrope"
|
rope_parameters["rope_type"] = "longrope"
|
||||||
|
|||||||
Reference in New Issue
Block a user