Update src/axolotl/utils/models.py

Co-authored-by: NanoCode012 <kevinvong@rocketmail.com>
This commit is contained in:
Wing Lian
2023-05-24 23:31:12 -04:00
committed by GitHub
parent ffd1043607
commit 1cf21daf51

View File

@@ -362,7 +362,11 @@ def load_lora(model, cfg):
PeftModel,
)
bits = 4 if cfg.load_in_4bits else 8 if cfg.load_in_8bits else None
bits = None
if cfg.cfg.load_in_4bits:
bits = 4
elif cfg.cfg.load_in_8bits:
bits = 8
linear_names = find_all_linear_names(bits, model)
logging.info(f"found linear modules: {repr(linear_names)}")
lora_target_modules = cfg.lora_target_modules + linear_names