File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1723,8 +1723,9 @@ def _get_and_verify_max_len(
17231723
17241724 rope_scaling = getattr (hf_config , "rope_scaling" , None )
17251725 if rope_scaling is not None :
1726- # Backwards compatibility. Although HF prefers "rope_type", we still
1727- # have code that accesses "type"
1726+ # Backwards compatibility. NOTE: This updates hf_config in-place!
1727+ # Although HF prefers "rope_type", we have code that accesses "type",
1728+ # so we populate both keys
17281729 if "type" in rope_scaling :
17291730 rope_type = rope_scaling ["rope_type" ] = rope_scaling ["type" ]
17301731 elif "rope_type" in rope_scaling :
@@ -1733,7 +1734,7 @@ def _get_and_verify_max_len(
17331734 raise ValueError (
17341735 "rope_scaling must have a 'type' or 'rope_type' key." )
17351736
1736- # Backwards compatibility
1737+ # Backwards compatibility. NOTE: This updates hf_config in-place!
17371738 if rope_type == "su" :
17381739 rope_scaling ["rope_type" ] = rope_type = "longrope"
17391740 logger .warning ("Replacing legacy rope_type 'su' with 'longrope'" )
You can’t perform that action at this time.
0 commit comments