Skip to content

Commit 8cfea45

Browse files
authored
Merge pull request axolotl-ai-cloud#52 from OpenAccess-AI-Collective/bugfix-cfg-cfg
cfg.cfg fix, also de-dupe lora module list
2 parents f8498d5 + 959d87b commit 8cfea45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/axolotl/utils/models.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,13 @@ def load_lora(model, cfg):
363363
)
364364

365365
bits = None
366-
if cfg.cfg.load_in_4bits:
366+
if cfg.load_in_4bit:
367367
bits = 4
368-
elif cfg.cfg.load_in_8bits:
368+
elif cfg.load_in_8bit:
369369
bits = 8
370370
linear_names = find_all_linear_names(bits, model)
371371
logging.info(f"found linear modules: {repr(linear_names)}")
372-
lora_target_modules = list(cfg.lora_target_modules) + linear_names
372+
lora_target_modules = list(set(list(cfg.lora_target_modules) + linear_names))
373373

374374
lora_config = LoraConfig(
375375
r=cfg.lora_r,

0 commit comments

Comments
 (0)