checking for False is not sufficent for NoneType/unset configs

This commit is contained in:
Wing Lian
2023-05-27 08:43:48 -04:00
parent c3d256271e
commit 4c500f5830

View File

@@ -5,12 +5,12 @@ def validate_config(cfg):
if cfg.adapter == "qlora":
if cfg.merge_lora:
# can't merge qlora if loaded in 8bit or 4bit
assert cfg.load_in_8bit is False
assert cfg.load_4bit is False
assert cfg.load_in_8bit is not True
assert cfg.load_4bit is not True
assert cfg.load_in_4bit is False
else:
assert cfg.load_in_8bit is False
assert cfg.load_4bit is False
assert cfg.load_in_8bit is not True
assert cfg.load_4bit is not True
assert cfg.load_in_4bit is True
if not cfg.load_in_8bit and cfg.adapter == "lora":
logging.warning("We recommend setting `load_in_8bit: true` for LORA finetuning")