From 676d7da661200ac438157d62b2edd283288fbe7a Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 25 May 2023 09:18:57 -0400 Subject: [PATCH 1/2] 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, From f523a0894c83fee00c8f10a8b3435ccf86f707bf Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 25 May 2023 09:23:56 -0400 Subject: [PATCH 2/2] stray s --- src/axolotl/utils/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/axolotl/utils/models.py b/src/axolotl/utils/models.py index ea7661c05..5b243bec4 100644 --- a/src/axolotl/utils/models.py +++ b/src/axolotl/utils/models.py @@ -363,9 +363,9 @@ def load_lora(model, cfg): ) bits = None - if cfg.load_in_4bits: + if cfg.load_in_4bit: bits = 4 - elif cfg.load_in_8bits: + elif cfg.load_in_8bit: bits = 8 linear_names = find_all_linear_names(bits, model) logging.info(f"found linear modules: {repr(linear_names)}")