File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
src/diffusers/pipelines/pixart_alpha Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ def encode_prompt(
394394
395395 # get unconditional embeddings for classifier free guidance
396396 if do_classifier_free_guidance and negative_prompt_embeds is None :
397- uncond_tokens = [negative_prompt ] * batch_size
397+ uncond_tokens = [negative_prompt ] * batch_size if isinstance ( negative_prompt , str ) else negative_prompt
398398 uncond_tokens = self ._text_preprocessing (uncond_tokens , clean_caption = clean_caption )
399399 max_length = prompt_embeds .shape [1 ]
400400 uncond_input = self .tokenizer (
Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ def encode_prompt(
320320
321321 # get unconditional embeddings for classifier free guidance
322322 if do_classifier_free_guidance and negative_prompt_embeds is None :
323- uncond_tokens = [negative_prompt ] * batch_size
323+ uncond_tokens = [negative_prompt ] * batch_size if isinstance ( negative_prompt , str ) else negative_prompt
324324 uncond_tokens = self ._text_preprocessing (uncond_tokens , clean_caption = clean_caption )
325325 max_length = prompt_embeds .shape [1 ]
326326 uncond_input = self .tokenizer (
You can’t perform that action at this time.
0 commit comments