winglian commited on
Commit
c9a149f
1 Parent(s): 958da70

add check for attr

Browse files
Files changed (1) hide show
  1. src/axolotl/utils/models.py +4 -1
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 cfg.sequence_len >= model.config.max_position_embeddings:
 
 
 
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
  )