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
1ade42f7
Commit
1ade42f7
authored
Oct 23, 2023
by
Patrick von Platen
Browse files
make style
parent
677df5ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
examples/dreambooth/train_dreambooth_lora_sdxl.py
examples/dreambooth/train_dreambooth_lora_sdxl.py
+2
-2
No files found.
examples/dreambooth/train_dreambooth_lora_sdxl.py
View file @
1ade42f7
...
@@ -1070,11 +1070,11 @@ def main(args):
...
@@ -1070,11 +1070,11 @@ def main(args):
if
args
.
train_text_encoder
:
if
args
.
train_text_encoder
:
text_encoder_one
.
train
()
text_encoder_one
.
train
()
text_encoder_two
.
train
()
text_encoder_two
.
train
()
# set top parameter requires_grad = True for gradient checkpointing works
# set top parameter requires_grad = True for gradient checkpointing works
text_encoder_one
.
text_model
.
embeddings
.
requires_grad_
(
True
)
text_encoder_one
.
text_model
.
embeddings
.
requires_grad_
(
True
)
text_encoder_two
.
text_model
.
embeddings
.
requires_grad_
(
True
)
text_encoder_two
.
text_model
.
embeddings
.
requires_grad_
(
True
)
for
step
,
batch
in
enumerate
(
train_dataloader
):
for
step
,
batch
in
enumerate
(
train_dataloader
):
with
accelerator
.
accumulate
(
unet
):
with
accelerator
.
accumulate
(
unet
):
pixel_values
=
batch
[
"pixel_values"
].
to
(
dtype
=
vae
.
dtype
)
pixel_values
=
batch
[
"pixel_values"
].
to
(
dtype
=
vae
.
dtype
)
...
...
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