"git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "dd65ee211ea5ec1c876d323c4387f066bee41a77"
Unverified Commit 24c062aa authored by YiYi Xu's avatar YiYi Xu Committed by GitHub
Browse files

update check_input for cogview4 (#10966)

fix
parent a74f02fb
...@@ -360,10 +360,16 @@ class CogView4Pipeline(DiffusionPipeline): ...@@ -360,10 +360,16 @@ class CogView4Pipeline(DiffusionPipeline):
) )
if prompt_embeds is not None and negative_prompt_embeds is not None: 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( raise ValueError(
"`prompt_embeds` and `negative_prompt_embeds` must have the same shape when passed directly, but" "`prompt_embeds` and `negative_prompt_embeds` must have the same batch size when passed directly, but"
f" got: `prompt_embeds` {prompt_embeds.shape} != `negative_prompt_embeds`" 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}." f" {negative_prompt_embeds.shape}."
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment