don't fail if can't cast weights due to offload when merging (#1172) [skip ci]

This commit is contained in:
Wing Lian
2024-01-23 09:17:08 -05:00
committed by GitHub
parent cc250391a0
commit fb7f9b9516

View File

@@ -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')}")