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:
|
if "merge_lora" in kwargs and cfg.adapter is not None:
|
||||||
logging.info("running merge of LoRA with base model")
|
logging.info("running merge of LoRA with base model")
|
||||||
model = model.merge_and_unload()
|
model = model.merge_and_unload()
|
||||||
|
model.to(dtype=torch.float16)
|
||||||
|
|
||||||
if cfg.local_rank == 0:
|
if cfg.local_rank == 0:
|
||||||
logging.info("saving merged model")
|
logging.info("saving merged model")
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
import logging
|
||||||
|
|
||||||
|
|
||||||
def validate_config(cfg):
|
def validate_config(cfg):
|
||||||
if cfg.adapter == "qlora":
|
if cfg.adapter == "qlora":
|
||||||
if cfg.merge_lora:
|
if cfg.merge_lora:
|
||||||
@@ -9,6 +12,9 @@ def validate_config(cfg):
|
|||||||
assert cfg.load_in_8bit is False
|
assert cfg.load_in_8bit is False
|
||||||
assert cfg.load_4bit is False
|
assert cfg.load_4bit is False
|
||||||
assert cfg.load_in_4bit is True
|
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
|
# TODO
|
||||||
# MPT 7b
|
# MPT 7b
|
||||||
# https://github.com/facebookresearch/bitsandbytes/issues/25
|
# https://github.com/facebookresearch/bitsandbytes/issues/25
|
||||||
|
|||||||
Reference in New Issue
Block a user