File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 :
You can’t perform that action at this time.
0 commit comments