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
c7bfb8b2
Unverified
Commit
c7bfb8b2
authored
Nov 27, 2023
by
Wang, Yi
Committed by
GitHub
Nov 27, 2023
Browse files
set the model to train state before accelerator prepare (#5099)
Signed-off-by:
Wang, Yi A
<
yi.a.wang@intel.com
>
parent
67d07074
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
examples/textual_inversion/textual_inversion.py
examples/textual_inversion/textual_inversion.py
+1
-0
No files found.
examples/textual_inversion/textual_inversion.py
View file @
c7bfb8b2
...
...
@@ -761,6 +761,7 @@ def main():
num_cycles
=
args
.
lr_num_cycles
,
)
text_encoder
.
train
()
# Prepare everything with our `accelerator`.
text_encoder
,
optimizer
,
train_dataloader
,
lr_scheduler
=
accelerator
.
prepare
(
text_encoder
,
optimizer
,
train_dataloader
,
lr_scheduler
...
...
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