Skip to content

Commit a81351b

Browse files
committed
updates
1 parent 5459b60 commit a81351b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/diffusers/loaders/peft.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ def _maybe_adjust_config(config):
7474
key_rank = rank_pattern[key]
7575

7676
# try to detect ambiguity
77+
# `target_modules` can also be a str, in which case this loop would loop
78+
# over the chars of the str. The technically correct way to match LoRA keys
79+
# in PEFT is to use LoraModel._check_target_module_exists (lora_config, key).
80+
# But this cuts it for now.
7781
exact_matches = [mod for mod in target_modules if mod == key]
7882
substring_matches = [mod for mod in target_modules if key in mod and mod != key]
7983
ambiguous_key = key

0 commit comments

Comments
 (0)