Skip to content

Commit

Permalink
don't fail if can't cast weights due to offload when merging (#1172) …
Browse files Browse the repository at this point in the history
…[skip ci]
  • Loading branch information
winglian authored Jan 23, 2024
1 parent cc25039 commit fb7f9b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/axolotl/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def do_merge_lora(

LOG.info("running merge of LoRA with base model")
model = model.merge_and_unload(progressbar=True)
model.to(dtype=cfg.torch_dtype)
try:
model.to(dtype=cfg.torch_dtype)
except RuntimeError:
pass

if cfg.local_rank == 0:
LOG.info(f"saving merged model to: {str(Path(cfg.output_dir) / 'merged')}")
Expand Down

0 comments on commit fb7f9b9

Please sign in to comment.