Skip to content

Commit

Permalink
Handle null rope scaling value (ggerganov#2793)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnb authored Aug 26, 2023
1 parent 2ba83c8 commit a2ca4e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ def loadHFTransformerJson(model: 'LazyModel', config_path: 'Path') -> 'Params':
f_norm_eps = config["rms_norm_eps"]
f_rope_freq_base = config["rope_theta"] if "rope_theta" in config else None

if "rope_scaling" in config and config["rope_scaling"].get("type") == "linear":
rope_scaling = config.get("rope_scaling")
if isinstance(rope_scaling, dict) and rope_scaling.get("type") == "linear":
f_rope_scale = config["rope_scaling"].get("factor")
else:
f_rope_scale = None
Expand Down

0 comments on commit a2ca4e9

Please sign in to comment.