Skip to content

Commit 090468c

Browse files
committed
add example.
1 parent 171fa24 commit 090468c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/diffusers/loaders/lora_conversion_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,9 @@ def handle_qkv(sds_sd, ait_sd, sds_key, ait_keys, dims=None):
990990

991991

992992
def _custom_replace(key: str, substrings: List[str]) -> str:
993+
# Replaces the "."s with "_"s upto the `substrings`.
994+
# Example:
995+
# lora_unet.foo.bar.lora_A.weight -> lora_unet_foo_bar.lora_A.weight
993996
pattern = "(" + "|".join(re.escape(sub) for sub in substrings) + ")"
994997

995998
match = re.search(pattern, key)

0 commit comments

Comments
 (0)