winglian Nanobit commited on
Commit
1cf21da
1 Parent(s): ffd1043

Update src/axolotl/utils/models.py

Browse files

Co-authored-by: NanoCode012 <kevinvong@rocketmail.com>

Files changed (1) hide show
  1. src/axolotl/utils/models.py +5 -1
src/axolotl/utils/models.py CHANGED
@@ -362,7 +362,11 @@ def load_lora(model, cfg):
362
  PeftModel,
363
  )
364
 
365
- bits = 4 if cfg.load_in_4bits else 8 if cfg.load_in_8bits else None
 
 
 
 
366
  linear_names = find_all_linear_names(bits, model)
367
  logging.info(f"found linear modules: {repr(linear_names)}")
368
  lora_target_modules = cfg.lora_target_modules + linear_names
 
362
  PeftModel,
363
  )
364
 
365
+ bits = None
366
+ if cfg.cfg.load_in_4bits:
367
+ bits = 4
368
+ elif cfg.cfg.load_in_8bits:
369
+ bits = 8
370
  linear_names = find_all_linear_names(bits, model)
371
  logging.info(f"found linear modules: {repr(linear_names)}")
372
  lora_target_modules = cfg.lora_target_modules + linear_names