From 676d7da661200ac438157d62b2edd283288fbe7a Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 25 May 2023 09:18:57 -0400 Subject: [PATCH] cfg.cfg fix, also de-dupe lora module list --- src/axolotl/utils/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/axolotl/utils/models.py b/src/axolotl/utils/models.py index ad0f2df94..ea7661c05 100644 --- a/src/axolotl/utils/models.py +++ b/src/axolotl/utils/models.py @@ -363,13 +363,13 @@ def load_lora(model, cfg): ) bits = None - if cfg.cfg.load_in_4bits: + if cfg.load_in_4bits: bits = 4 - elif cfg.cfg.load_in_8bits: + elif 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 = list(cfg.lora_target_modules) + linear_names + lora_target_modules = list(set(list(cfg.lora_target_modules) + linear_names)) lora_config = LoraConfig( r=cfg.lora_r,