-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[Fix]Allow prompt and prior_token_ids to be provided simultaneously in GlmImagePipeline
#13092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -658,12 +658,7 @@ def check_inputs( | |||||
| ) | ||||||
| elif prompt is not None and (not isinstance(prompt, str) and not isinstance(prompt, list)): | ||||||
| raise ValueError(f"`prompt` has to be of type `str` or `list` but is {type(prompt)}") | ||||||
| if prompt is not None and prior_token_ids is not None: | ||||||
| raise ValueError( | ||||||
| f"Cannot forward both `prompt`: {prompt} and `prior_token_ids`: {prior_token_ids}. Please make sure to" | ||||||
| " only forward one of the two." | ||||||
| ) | ||||||
| elif prompt is None and prior_token_ids is None: | ||||||
| if prompt is None and prior_token_ids is None: | ||||||
| raise ValueError( | ||||||
| "Provide either `prompt` or `prior_token_ids`. Cannot leave both `prompt` and `prior_token_ids` undefined." | ||||||
| ) | ||||||
|
|
@@ -694,8 +689,8 @@ def check_inputs( | |||||
| "for i2i mode, as the images are needed for VAE encoding to build the KV cache." | ||||||
| ) | ||||||
|
|
||||||
| if prior_token_ids is not None and prompt_embeds is None: | ||||||
| raise ValueError("`prompt_embeds` must also be provided with `prior_token_ids`.") | ||||||
| if prior_token_ids is not None and prompt_embeds is None and prompt is None: | ||||||
| raise ValueError("`prompt_embeds` or `prompt` must also be provided with `prior_token_ids`.") | ||||||
|
|
||||||
|
Comment on lines
+692
to
694
|
||||||
| if prior_token_ids is not None and prompt_embeds is None and prompt is None: | |
| raise ValueError("`prompt_embeds` or `prompt` must also be provided with `prior_token_ids`.") |
Uh oh!
There was an error while loading. Please reload this page.