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
dccf39f0
Unverified
Commit
dccf39f0
authored
Oct 15, 2024
by
0x名無し
Committed by
GitHub
Oct 15, 2024
Browse files
Dreambooth lora flux bug 3dtensor to 2dtensor (#9653)
* fixed issue #9350, Tensor is deprecated * ran make style
parent
99d87474
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
examples/dreambooth/train_dreambooth_lora_flux.py
examples/dreambooth/train_dreambooth_lora_flux.py
+1
-3
No files found.
examples/dreambooth/train_dreambooth_lora_flux.py
View file @
dccf39f0
...
@@ -985,7 +985,6 @@ def encode_prompt(
...
@@ -985,7 +985,6 @@ def encode_prompt(
text_input_ids_list
=
None
,
text_input_ids_list
=
None
,
):
):
prompt
=
[
prompt
]
if
isinstance
(
prompt
,
str
)
else
prompt
prompt
=
[
prompt
]
if
isinstance
(
prompt
,
str
)
else
prompt
batch_size
=
len
(
prompt
)
dtype
=
text_encoders
[
0
].
dtype
dtype
=
text_encoders
[
0
].
dtype
pooled_prompt_embeds
=
_encode_prompt_with_clip
(
pooled_prompt_embeds
=
_encode_prompt_with_clip
(
...
@@ -1007,8 +1006,7 @@ def encode_prompt(
...
@@ -1007,8 +1006,7 @@ def encode_prompt(
text_input_ids
=
text_input_ids_list
[
1
]
if
text_input_ids_list
else
None
,
text_input_ids
=
text_input_ids_list
[
1
]
if
text_input_ids_list
else
None
,
)
)
text_ids
=
torch
.
zeros
(
batch_size
,
prompt_embeds
.
shape
[
1
],
3
).
to
(
device
=
device
,
dtype
=
dtype
)
text_ids
=
torch
.
zeros
(
prompt_embeds
.
shape
[
1
],
3
).
to
(
device
=
device
,
dtype
=
dtype
)
text_ids
=
text_ids
.
repeat
(
num_images_per_prompt
,
1
,
1
)
return
prompt_embeds
,
pooled_prompt_embeds
,
text_ids
return
prompt_embeds
,
pooled_prompt_embeds
,
text_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