From 7209a6ae0bcba6f26f3b6e494e754b018d311c28 Mon Sep 17 00:00:00 2001 From: caiyesd Date: Thu, 23 Nov 2023 10:46:58 +0800 Subject: [PATCH] Fix n_ctx issue for Baichuan & Baichuan2 13B model Signed-off-by: caiyesd --- convert.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/convert.py b/convert.py index 3ad836ce0..f113c94f4 100644 --- a/convert.py +++ b/convert.py @@ -229,6 +229,8 @@ class Params: n_ctx = config["max_sequence_length"] elif "max_position_embeddings" in config: n_ctx = config["max_position_embeddings"] + elif "model_max_length" in config: + n_ctx = config["model_max_length"] else: raise Exception("failed to guess 'n_ctx'. This model is unknown or unsupported.\n" "Suggestion: provide 'config.json' of the model in the same directory containing model files.")