winglian commited on
Commit
4c500f5
1 Parent(s): c3d2562

checking for False is not sufficent for NoneType/unset configs

Browse files
Files changed (1) hide show
  1. src/axolotl/utils/validation.py +4 -4
src/axolotl/utils/validation.py CHANGED
@@ -5,12 +5,12 @@ def validate_config(cfg):
5
  if cfg.adapter == "qlora":
6
  if cfg.merge_lora:
7
  # can't merge qlora if loaded in 8bit or 4bit
8
- assert cfg.load_in_8bit is False
9
- assert cfg.load_4bit is False
10
  assert cfg.load_in_4bit is False
11
  else:
12
- assert cfg.load_in_8bit is False
13
- assert cfg.load_4bit is False
14
  assert cfg.load_in_4bit is True
15
  if not cfg.load_in_8bit and cfg.adapter == "lora":
16
  logging.warning("We recommend setting `load_in_8bit: true` for LORA finetuning")
 
5
  if cfg.adapter == "qlora":
6
  if cfg.merge_lora:
7
  # can't merge qlora if loaded in 8bit or 4bit
8
+ assert cfg.load_in_8bit is not True
9
+ assert cfg.load_4bit is not True
10
  assert cfg.load_in_4bit is False
11
  else:
12
+ assert cfg.load_in_8bit is not True
13
+ assert cfg.load_4bit is not True
14
  assert cfg.load_in_4bit is True
15
  if not cfg.load_in_8bit and cfg.adapter == "lora":
16
  logging.warning("We recommend setting `load_in_8bit: true` for LORA finetuning")