Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
diffusers
Commits
17470057
Commit
17470057
authored
Apr 20, 2023
by
Patrick von Platen
Browse files
make style
parent
3979aac9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/diffusers/loaders.py
src/diffusers/loaders.py
+1
-1
tests/models/test_lora_layers.py
tests/models/test_lora_layers.py
+1
-1
No files found.
src/diffusers/loaders.py
View file @
17470057
...
...
@@ -848,7 +848,7 @@ class LoraLoaderMixin:
"""
# Loop over the original attention modules.
for
name
,
_
in
self
.
text_encoder
.
named_modules
():
if
any
(
[
x
in
name
for
x
in
TEXT_ENCODER_TARGET_MODULES
]
):
if
any
(
x
in
name
for
x
in
TEXT_ENCODER_TARGET_MODULES
):
# Retrieve the module and its corresponding LoRA processor.
module
=
self
.
text_encoder
.
get_submodule
(
name
)
# Construct a new function that performs the LoRA merging. We will monkey patch
...
...
tests/models/test_lora_layers.py
View file @
17470057
...
...
@@ -46,7 +46,7 @@ def create_unet_lora_layers(unet: nn.Module):
def
create_text_encoder_lora_layers
(
text_encoder
:
nn
.
Module
):
text_lora_attn_procs
=
{}
for
name
,
module
in
text_encoder
.
named_modules
():
if
any
(
[
x
in
name
for
x
in
TEXT_ENCODER_TARGET_MODULES
]
):
if
any
(
x
in
name
for
x
in
TEXT_ENCODER_TARGET_MODULES
):
text_lora_attn_procs
[
name
]
=
LoRAAttnProcessor
(
hidden_size
=
module
.
out_features
,
cross_attention_dim
=
None
)
text_encoder_lora_layers
=
AttnProcsLayers
(
text_lora_attn_procs
)
return
text_encoder_lora_layers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment