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
33c48745
Unverified
Commit
33c48745
authored
Nov 03, 2022
by
Yuta Hayashibe
Committed by
GitHub
Nov 02, 2022
Browse files
Fix padding in dreambooth (#1030)
parent
5cd29d62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
examples/dreambooth/train_dreambooth.py
examples/dreambooth/train_dreambooth.py
+6
-1
No files found.
examples/dreambooth/train_dreambooth.py
View file @
33c48745
...
...
@@ -494,7 +494,12 @@ def main(args):
pixel_values
=
torch
.
stack
(
pixel_values
)
pixel_values
=
pixel_values
.
to
(
memory_format
=
torch
.
contiguous_format
).
float
()
input_ids
=
tokenizer
.
pad
({
"input_ids"
:
input_ids
},
padding
=
True
,
return_tensors
=
"pt"
).
input_ids
input_ids
=
tokenizer
.
pad
(
{
"input_ids"
:
input_ids
},
padding
=
"max_length"
,
max_length
=
tokenizer
.
model_max_length
,
return_tensors
=
"pt"
,
).
input_ids
batch
=
{
"input_ids"
:
input_ids
,
...
...
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