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
4a98d6e0
Unverified
Commit
4a98d6e0
authored
Mar 24, 2023
by
Haofan Wang
Committed by
GitHub
Mar 24, 2023
Browse files
Update train_text_to_image_lora.py (#2795)
parent
b94880e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
examples/research_projects/lora/train_text_to_image_lora.py
examples/research_projects/lora/train_text_to_image_lora.py
+2
-2
No files found.
examples/research_projects/lora/train_text_to_image_lora.py
View file @
4a98d6e0
...
@@ -542,8 +542,8 @@ def main():
...
@@ -542,8 +542,8 @@ def main():
lora_layers
=
AttnProcsLayers
(
unet
.
attn_processors
)
lora_layers
=
AttnProcsLayers
(
unet
.
attn_processors
)
# Move unet, vae and text_encoder to device and cast to weight_dtype
# Move unet, vae and text_encoder to device and cast to weight_dtype
unet
.
to
(
accelerator
.
device
,
dtype
=
weight_dtype
)
vae
.
to
(
accelerator
.
device
,
dtype
=
weight_dtype
)
vae
.
to
(
accelerator
.
device
,
dtype
=
weight_dtype
)
if
not
args
.
train_text_encoder
:
text_encoder
.
to
(
accelerator
.
device
,
dtype
=
weight_dtype
)
text_encoder
.
to
(
accelerator
.
device
,
dtype
=
weight_dtype
)
if
args
.
enable_xformers_memory_efficient_attention
:
if
args
.
enable_xformers_memory_efficient_attention
:
...
...
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