From a14a033fb7c7878bed6ace56e92a72bbeba0c876 Mon Sep 17 00:00:00 2001 From: Nigel Bosch Date: Fri, 25 Aug 2023 12:00:50 -0500 Subject: [PATCH] Handle null rope scaling value --- convert.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/convert.py b/convert.py index 4f3e927982632..d44e5a8c48d9d 100755 --- a/convert.py +++ b/convert.py @@ -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