don't fail if can't cast weights due to offload when merging (#1172) [skip ci]
Browse files
src/axolotl/cli/__init__.py
CHANGED
|
@@ -78,7 +78,10 @@ def do_merge_lora(
|
|
| 78 |
|
| 79 |
LOG.info("running merge of LoRA with base model")
|
| 80 |
model = model.merge_and_unload(progressbar=True)
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
if cfg.local_rank == 0:
|
| 84 |
LOG.info(f"saving merged model to: {str(Path(cfg.output_dir) / 'merged')}")
|
|
|
|
| 78 |
|
| 79 |
LOG.info("running merge of LoRA with base model")
|
| 80 |
model = model.merge_and_unload(progressbar=True)
|
| 81 |
+
try:
|
| 82 |
+
model.to(dtype=cfg.torch_dtype)
|
| 83 |
+
except RuntimeError:
|
| 84 |
+
pass
|
| 85 |
|
| 86 |
if cfg.local_rank == 0:
|
| 87 |
LOG.info(f"saving merged model to: {str(Path(cfg.output_dir) / 'merged')}")
|