From aa896e790b2f104b826ef9e60a40b741f94a898b Mon Sep 17 00:00:00 2001 From: Nigel Bosch Date: Thu, 24 Aug 2023 17:22:53 -0500 Subject: [PATCH] Rewrite for clarity --- convert.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/convert.py b/convert.py index ee8a671a1..91e68ff18 100755 --- a/convert.py +++ b/convert.py @@ -168,7 +168,11 @@ class Params: n_head = config["num_attention_heads"] n_head_kv = config["num_key_value_heads"] if "num_key_value_heads" in config else n_head f_norm_eps = config["rms_norm_eps"] - f_rope_scale = config.get("rope_scaling", {}).get("factor", None) if config.get("rope_scaling", {}).get("type", "") == "linear" else None + + if "rope_scaling" in config and config["rope_scaling"].get("type") == "linear": + f_rope_scale = config["rope_scaling"].get("factor") + else: + f_rope_scale = None n_mult = Params.find_n_mult(n_ff, n_embd)