From c9a149f9e8bacdcd59a9e6de435499b2f4a845c1 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Sun, 11 Jun 2023 10:11:17 -0400 Subject: [PATCH] add check for attr --- src/axolotl/utils/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/axolotl/utils/models.py b/src/axolotl/utils/models.py index 49a9b6f85..532fa5518 100644 --- a/src/axolotl/utils/models.py +++ b/src/axolotl/utils/models.py @@ -300,7 +300,10 @@ def load_model( embeddings_len = math.ceil(len(tokenizer) / 32) * 32 model.resize_token_embeddings(embeddings_len) - if cfg.sequence_len >= model.config.max_position_embeddings: + if ( + hasattr(model.config, "max_position_embeddings") + and cfg.sequence_len >= model.config.max_position_embeddings + ): logging.warning( f"increasing model.config.max_position_embeddings to {cfg.sequence_len}" )