Skip to content

Commit 958e2b4

Browse files
pnbakawrykow
authored andcommitted
Handle null rope scaling value (ggml-org#2793)
1 parent e09ef49 commit 958e2b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

convert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ def loadHFTransformerJson(model: 'LazyModel', config_path: 'Path') -> 'Params':
170170
f_norm_eps = config["rms_norm_eps"]
171171
f_rope_freq_base = config["rope_theta"] if "rope_theta" in config else None
172172

173-
if "rope_scaling" in config and config["rope_scaling"].get("type") == "linear":
173+
rope_scaling = config.get("rope_scaling")
174+
if isinstance(rope_scaling, dict) and rope_scaling.get("type") == "linear":
174175
f_rope_scale = config["rope_scaling"].get("factor")
175176
else:
176177
f_rope_scale = None

0 commit comments

Comments
 (0)