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
2c25b98c
Unverified
Commit
2c25b98c
authored
Jul 24, 2024
by
Sayak Paul
Committed by
GitHub
Jul 24, 2024
Browse files
[AuraFlow] fix long prompt handling (#8937)
fix
parent
93983b67
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/diffusers/pipelines/aura_flow/pipeline_aura_flow.py
src/diffusers/pipelines/aura_flow/pipeline_aura_flow.py
+1
-1
No files found.
src/diffusers/pipelines/aura_flow/pipeline_aura_flow.py
View file @
2c25b98c
...
...
@@ -260,7 +260,6 @@ class AuraFlowPipeline(DiffusionPipeline):
padding
=
"max_length"
,
return_tensors
=
"pt"
,
)
text_inputs
=
{
k
:
v
.
to
(
device
)
for
k
,
v
in
text_inputs
.
items
()}
text_input_ids
=
text_inputs
[
"input_ids"
]
untruncated_ids
=
self
.
tokenizer
(
prompt
,
padding
=
"longest"
,
return_tensors
=
"pt"
).
input_ids
...
...
@@ -273,6 +272,7 @@ class AuraFlowPipeline(DiffusionPipeline):
f
"
{
max_length
}
tokens:
{
removed_text
}
"
)
text_inputs
=
{
k
:
v
.
to
(
device
)
for
k
,
v
in
text_inputs
.
items
()}
prompt_embeds
=
self
.
text_encoder
(
**
text_inputs
)[
0
]
prompt_attention_mask
=
text_inputs
[
"attention_mask"
].
unsqueeze
(
-
1
).
expand
(
prompt_embeds
.
shape
)
prompt_embeds
=
prompt_embeds
*
prompt_attention_mask
...
...
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