don't fail if can't cast weights due to offload when merging (#1172) [skip ci]
This commit is contained in:
@@ -78,7 +78,10 @@ def do_merge_lora(
|
|||||||
|
|
||||||
LOG.info("running merge of LoRA with base model")
|
LOG.info("running merge of LoRA with base model")
|
||||||
model = model.merge_and_unload(progressbar=True)
|
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:
|
if cfg.local_rank == 0:
|
||||||
LOG.info(f"saving merged model to: {str(Path(cfg.output_dir) / 'merged')}")
|
LOG.info(f"saving merged model to: {str(Path(cfg.output_dir) / 'merged')}")
|
||||||
|
|||||||
Reference in New Issue
Block a user