add logging and make sure model unloads to float16
This commit is contained in:
@@ -176,6 +176,7 @@ def train(
|
||||
if "merge_lora" in kwargs and cfg.adapter is not None:
|
||||
logging.info("running merge of LoRA with base model")
|
||||
model = model.merge_and_unload()
|
||||
model.to(dtype=torch.float16)
|
||||
|
||||
if cfg.local_rank == 0:
|
||||
logging.info("saving merged model")
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import logging
|
||||
|
||||
|
||||
def validate_config(cfg):
|
||||
if cfg.adapter == "qlora":
|
||||
if cfg.merge_lora:
|
||||
@@ -9,6 +12,9 @@ def validate_config(cfg):
|
||||
assert cfg.load_in_8bit is False
|
||||
assert cfg.load_4bit is False
|
||||
assert cfg.load_in_4bit is True
|
||||
if cfg.load_in_8bit and cfg.adapter == "lora":
|
||||
logging.warning("we recommend setting `load_in_8bit: true`")
|
||||
|
||||
# TODO
|
||||
# MPT 7b
|
||||
# https://github.com/facebookresearch/bitsandbytes/issues/25
|
||||
|
||||
Reference in New Issue
Block a user