Skip to content

Commit

Permalink
ignore issues with calculating # params when printing (#1493)
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian authored Apr 8, 2024
1 parent 9430b6e commit 2fa65b9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/axolotl/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,12 @@ def load_lora(model, cfg, inference=False, config_only=False):
model = get_peft_model(model, lora_config)

if rank == 0:
model.print_trainable_parameters()
try:
model.print_trainable_parameters()
except AttributeError as exc:
LOG.warning(
"Exception caught during model.print_trainable_parameters(): %s", exc
)
elif cfg.fsdp and cfg.adapter == "qlora":
setup_quantized_peft_meta_for_training(model)

Expand Down

0 comments on commit 2fa65b9

Please sign in to comment.