]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Handle null rope scaling value (#2793)
authorNigel Bosch <redacted>
Sat, 26 Aug 2023 12:11:17 +0000 (07:11 -0500)
committerGitHub <redacted>
Sat, 26 Aug 2023 12:11:17 +0000 (14:11 +0200)
convert.py

index 4f3e9279826322ecef826c5ca85eb26ebe6500b7..d44e5a8c48d9d4540607c1bd83626ad1348b7c5a 100755 (executable)
@@ -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