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
6dc64865
Unverified
Commit
6dc64865
authored
Sep 13, 2024
by
Sayak Paul
Committed by
GitHub
Sep 13, 2024
Browse files
[LoRA] fix adapter movement when using DoRA. (#9411)
fix adapter movement when using DoRA.
parent
1e8cf276
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
src/diffusers/loaders/lora_base.py
src/diffusers/loaders/lora_base.py
+4
-3
No files found.
src/diffusers/loaders/lora_base.py
View file @
6dc64865
...
@@ -699,6 +699,7 @@ class LoraBaseMixin:
...
@@ -699,6 +699,7 @@ class LoraBaseMixin:
module
.
lora_B
[
adapter_name
].
to
(
device
)
module
.
lora_B
[
adapter_name
].
to
(
device
)
# this is a param, not a module, so device placement is not in-place -> re-assign
# this is a param, not a module, so device placement is not in-place -> re-assign
if
hasattr
(
module
,
"lora_magnitude_vector"
)
and
module
.
lora_magnitude_vector
is
not
None
:
if
hasattr
(
module
,
"lora_magnitude_vector"
)
and
module
.
lora_magnitude_vector
is
not
None
:
if
adapter_name
in
module
.
lora_magnitude_vector
:
module
.
lora_magnitude_vector
[
adapter_name
]
=
module
.
lora_magnitude_vector
[
module
.
lora_magnitude_vector
[
adapter_name
]
=
module
.
lora_magnitude_vector
[
adapter_name
adapter_name
].
to
(
device
)
].
to
(
device
)
...
...
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