Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
8d30d257
Unverified
Commit
8d30d257
authored
Aug 22, 2023
by
Sayak Paul
Committed by
GitHub
Aug 22, 2023
Browse files
[LoRA] default to None when fc alphas are not available. (#4706)
default to None when fc alphas are not available.
parent
1e0395e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/diffusers/loaders.py
src/diffusers/loaders.py
+3
-2
No files found.
src/diffusers/loaders.py
View file @
8d30d257
...
@@ -1400,8 +1400,9 @@ class LoraLoaderMixin:
...
@@ -1400,8 +1400,9 @@ class LoraLoaderMixin:
if
patch_mlp
:
if
patch_mlp
:
for
name
,
mlp_module
in
text_encoder_mlp_modules
(
text_encoder
):
for
name
,
mlp_module
in
text_encoder_mlp_modules
(
text_encoder
):
fc1_alpha
=
network_alphas
.
pop
(
name
+
".fc1.lora_linear_layer.down.weight.alpha"
)
fc1_alpha
=
network_alphas
.
pop
(
name
+
".fc1.lora_linear_layer.down.weight.alpha"
,
None
)
fc2_alpha
=
network_alphas
.
pop
(
name
+
".fc2.lora_linear_layer.down.weight.alpha"
)
fc2_alpha
=
network_alphas
.
pop
(
name
+
".fc2.lora_linear_layer.down.weight.alpha"
,
None
)
current_rank_fc1
=
rank
.
pop
(
f
"
{
name
}
.fc1.lora_linear_layer.up.weight"
)
current_rank_fc1
=
rank
.
pop
(
f
"
{
name
}
.fc1.lora_linear_layer.up.weight"
)
current_rank_fc2
=
rank
.
pop
(
f
"
{
name
}
.fc2.lora_linear_layer.up.weight"
)
current_rank_fc2
=
rank
.
pop
(
f
"
{
name
}
.fc2.lora_linear_layer.up.weight"
)
...
...
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