From 1cf21daf5112b1dd202b3c51cce540c40d0bbd63 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Wed, 24 May 2023 23:31:12 -0400 Subject: [PATCH] Update src/axolotl/utils/models.py Co-authored-by: NanoCode012 --- src/axolotl/utils/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/axolotl/utils/models.py b/src/axolotl/utils/models.py index 7e1d91aa1..554f5be23 100644 --- a/src/axolotl/utils/models.py +++ b/src/axolotl/utils/models.py @@ -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