summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNigel Bosch <pnigelb@gmail.com>2023-08-26 07:11:17 -0500
committerGitHub <noreply@github.com>2023-08-26 14:11:17 +0200
commita2ca4e9de9da45ed0bb1c34935d5ec80cebc22d5 (patch)
tree999c745f003c9be1320799fd483066aec03675d0
parent2ba83c8685177faea3399db9564f9c52df75c366 (diff)
Handle null rope scaling value (#2793)
-rwxr-xr-xconvert.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/convert.py b/convert.py
index 4f3e9279..d44e5a8c 100755
--- a/convert.py
+++ b/convert.py
@@ -170,7 +170,8 @@ class 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