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
24c062aa
Unverified
Commit
24c062aa
authored
Mar 04, 2025
by
YiYi Xu
Committed by
GitHub
Mar 04, 2025
Browse files
update check_input for cogview4 (#10966)
fix
parent
a74f02fb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
src/diffusers/pipelines/cogview4/pipeline_cogview4.py
src/diffusers/pipelines/cogview4/pipeline_cogview4.py
+9
-3
No files found.
src/diffusers/pipelines/cogview4/pipeline_cogview4.py
View file @
24c062aa
...
...
@@ -360,10 +360,16 @@ class CogView4Pipeline(DiffusionPipeline):
)
if
prompt_embeds
is
not
None
and
negative_prompt_embeds
is
not
None
:
if
prompt_embeds
.
shape
!=
negative_prompt_embeds
.
shape
:
if
prompt_embeds
.
shape
[
0
]
!=
negative_prompt_embeds
.
shape
[
0
]
:
raise
ValueError
(
"`prompt_embeds` and `negative_prompt_embeds` must have the same shape when passed directly, but"
f
" got: `prompt_embeds`
{
prompt_embeds
.
shape
}
!= `negative_prompt_embeds`"
"`prompt_embeds` and `negative_prompt_embeds` must have the same batch size when passed directly, but"
f
" got: `prompt_embeds`
{
prompt_embeds
.
shape
}
and `negative_prompt_embeds`"
f
"
{
negative_prompt_embeds
.
shape
}
."
)
if
prompt_embeds
.
shape
[
-
1
]
!=
negative_prompt_embeds
.
shape
[
-
1
]:
raise
ValueError
(
"`prompt_embeds` and `negative_prompt_embeds` must have the same dimension when passed directly, but"
f
" got: `prompt_embeds`
{
prompt_embeds
.
shape
}
and `negative_prompt_embeds`"
f
"
{
negative_prompt_embeds
.
shape
}
."
)
...
...
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