winglian commited on
Commit
48f4c05
1 Parent(s): 1987e5c

fix validation for qlora merge

Browse files
Files changed (1) hide show
  1. src/axolotl/utils/validation.py +9 -4
src/axolotl/utils/validation.py CHANGED
@@ -1,9 +1,14 @@
1
  def validate_config(cfg):
2
  if cfg.adapter == "qlora":
3
- assert cfg.load_in_8bit is False
4
- assert cfg.load_4bit is False
5
- assert cfg.load_in_4bit is True
6
- pass
 
 
 
 
 
7
  # TODO
8
  # MPT 7b
9
  # https://github.com/facebookresearch/bitsandbytes/issues/25
 
1
  def validate_config(cfg):
2
  if cfg.adapter == "qlora":
3
+ if cfg.merge_lora:
4
+ # can't merge qlora if loaded in 8bit or 4bit
5
+ assert cfg.load_in_8bit is False
6
+ assert cfg.load_4bit is False
7
+ assert cfg.load_in_4bit is False
8
+ else:
9
+ assert cfg.load_in_8bit is False
10
+ assert cfg.load_4bit is False
11
+ assert cfg.load_in_4bit is True
12
  # TODO
13
  # MPT 7b
14
  # https://github.com/facebookresearch/bitsandbytes/issues/25