Skip to content

Commit 940cfd7

Browse files
committed
fix
Signed-off-by: Alexandros Koumparoulis <[email protected]>
1 parent 79e469b commit 940cfd7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

nemo_automodel/components/_peft/lora.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,10 @@ def apply_lora_to_linear_modules(
341341
w.requires_grad_(False)
342342

343343
matcher = ModuleMatcher(
344-
peft_config.target_modules, peft_config.exclude_modules, peft_config.match_all_linear, model,
344+
peft_config.target_modules,
345+
peft_config.exclude_modules,
346+
peft_config.match_all_linear,
347+
model,
345348
)
346349
num_modules_matched = 0
347350
for name, module in list(model.named_modules()):

nemo_automodel/components/_peft/module_matcher.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def wildcard_match(pattern, key):
3636
match = regex_pattern.match(key)
3737
return match is not None
3838

39+
3940
def _get_model_embedding_ptrs(model: nn.Module) -> list[str]:
4041
ptrs = []
4142
for name, module in model.named_modules():
@@ -44,6 +45,7 @@ def _get_model_embedding_ptrs(model: nn.Module) -> list[str]:
4445
ptrs.append(module.weight.data_ptr())
4546
return ptrs
4647

48+
4749
def _get_tied_target_modules(model: nn.Module) -> list[str]:
4850
if model is None:
4951
return []

0 commit comments

Comments
 (0)