add check for attr
Browse files
src/axolotl/utils/models.py
CHANGED
@@ -300,7 +300,10 @@ def load_model(
|
|
300 |
embeddings_len = math.ceil(len(tokenizer) / 32) * 32
|
301 |
model.resize_token_embeddings(embeddings_len)
|
302 |
|
303 |
-
if
|
|
|
|
|
|
|
304 |
logging.warning(
|
305 |
f"increasing model.config.max_position_embeddings to {cfg.sequence_len}"
|
306 |
)
|
|
|
300 |
embeddings_len = math.ceil(len(tokenizer) / 32) * 32
|
301 |
model.resize_token_embeddings(embeddings_len)
|
302 |
|
303 |
+
if (
|
304 |
+
hasattr(model.config, "max_position_embeddings")
|
305 |
+
and cfg.sequence_len >= model.config.max_position_embeddings
|
306 |
+
):
|
307 |
logging.warning(
|
308 |
f"increasing model.config.max_position_embeddings to {cfg.sequence_len}"
|
309 |
)
|