






"""simple docstring"""
import json
import os
from functools import lru_cache
from typing import List, Optional, Tuple

import regex as re

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...utils import logging


lowerCamelCase_       			=   logging.get_logger(__name__)


lowerCamelCase_       			=   {"""vocab_file""": """vocab.json""", """merges_file""": """merges.txt"""}

# See all BART models at https://huggingface.co/models?filter=bart
lowerCamelCase_       			=   {
    """vocab_file""": {
        """facebook/bart-base""": """https://huggingface.co/facebook/bart-base/resolve/main/vocab.json""",
        """facebook/bart-large""": """https://huggingface.co/facebook/bart-large/resolve/main/vocab.json""",
        """facebook/bart-large-mnli""": """https://huggingface.co/facebook/bart-large-mnli/resolve/main/vocab.json""",
        """facebook/bart-large-cnn""": """https://huggingface.co/facebook/bart-large-cnn/resolve/main/vocab.json""",
        """facebook/bart-large-xsum""": """https://huggingface.co/facebook/bart-large-xsum/resolve/main/vocab.json""",
        """yjernite/bart_eli5""": """https://huggingface.co/yjernite/bart_eli5/resolve/main/vocab.json""",
    },
    """merges_file""": {
        """facebook/bart-base""": """https://huggingface.co/facebook/bart-base/resolve/main/merges.txt""",
        """facebook/bart-large""": """https://huggingface.co/facebook/bart-large/resolve/main/merges.txt""",
        """facebook/bart-large-mnli""": """https://huggingface.co/facebook/bart-large-mnli/resolve/main/merges.txt""",
        """facebook/bart-large-cnn""": """https://huggingface.co/facebook/bart-large-cnn/resolve/main/merges.txt""",
        """facebook/bart-large-xsum""": """https://huggingface.co/facebook/bart-large-xsum/resolve/main/merges.txt""",
        """yjernite/bart_eli5""": """https://huggingface.co/yjernite/bart_eli5/resolve/main/merges.txt""",
    },
}

lowerCamelCase_       			=   {
    """facebook/bart-base""": 1024,
    """facebook/bart-large""": 1024,
    """facebook/bart-large-mnli""": 1024,
    """facebook/bart-large-cnn""": 1024,
    """facebook/bart-large-xsum""": 1024,
    """yjernite/bart_eli5""": 1024,
}

@lru_cache()
def  snake_case   (     ):
			UpperCAmelCase_  :				Dict      =      (
			    list(range(ord("!"		)			,ord("~"		) + 1		)		) + list(range(ord("¡"		)			,ord("¬"		) + 1		)		) + list(range(ord("®"		)			,ord("ÿ"		) + 1		)		)
			)
			UpperCAmelCase_  :				Dict      =      bs[:]
			UpperCAmelCase_  :				Dict      =      0
			for b in range(2**8		):
						if b not in bs:
									bs.append(snake_case_		)
									cs.append(2**8 + n		)
									n += 1
			UpperCAmelCase_  :				Tuple      =      [chr(snake_case_		) for n in cs]
			return dict(zip(snake_case_			,snake_case_		)		)

def  snake_case   (     A__		):
			UpperCAmelCase_  :				Optional[int]      =      set()
			UpperCAmelCase_  :				List[str]      =      word[0]
			for char in word[1:]:
						pairs.add((prev_char, char)		)
						UpperCAmelCase_  :				Union[str, Any]      =      char
			return pairs







class     UpperCamelCase_ (UpperCamelCase_  ):
	__magic_name__			   =       VOCAB_FILES_NAMES
	__magic_name__			   =       PRETRAINED_VOCAB_FILES_MAP
	__magic_name__			   =       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	__magic_name__			   =       ['''input_ids''', '''attention_mask''']





	def __init__(   self      :				int			,			lowerCAmelCase_      :				Tuple			,			lowerCAmelCase_      :				Tuple			,			lowerCAmelCase_      :				Optional[int]="replace"			,			lowerCAmelCase_      :				Union[str, Any]="<s>"			,			lowerCAmelCase_      :				str="</s>"			,			lowerCAmelCase_      :				List[Any]="</s>"			,			lowerCAmelCase_      :				Union[str, Any]="<s>"			,			lowerCAmelCase_      :				Optional[int]="<unk>"			,			lowerCAmelCase_      :				Optional[int]="<pad>"			,			lowerCAmelCase_      :				Optional[Any]="<mask>"			,			lowerCAmelCase_      :				Optional[Any]=False			,			**lowerCAmelCase_      :				List[Any]			,			)		->    Tuple:
				UpperCAmelCase_  :				Any      =      AddedToken(__A			,			lstrip=__A			,			rstrip=__A		) if isinstance(__A			,			__A		) else bos_token
				UpperCAmelCase_  :				List[Any]      =      AddedToken(__A			,			lstrip=__A			,			rstrip=__A		) if isinstance(__A			,			__A		) else eos_token
				UpperCAmelCase_  :				Union[str, Any]      =      AddedToken(__A			,			lstrip=__A			,			rstrip=__A		) if isinstance(__A			,			__A		) else sep_token
				UpperCAmelCase_  :				int      =      AddedToken(__A			,			lstrip=__A			,			rstrip=__A		) if isinstance(__A			,			__A		) else cls_token
				UpperCAmelCase_  :				Dict      =      AddedToken(__A			,			lstrip=__A			,			rstrip=__A		) if isinstance(__A			,			__A		) else unk_token
				UpperCAmelCase_  :				int      =      AddedToken(__A			,			lstrip=__A			,			rstrip=__A		) if isinstance(__A			,			__A		) else pad_token

				# Mask token behave like a normal word, i.e. include the space before it
				UpperCAmelCase_  :				int      =      AddedToken(__A			,			lstrip=__A			,			rstrip=__A		) if isinstance(__A			,			__A		) else mask_token

				super().__init__(
				    errors=__A			,			bos_token=__A			,			eos_token=__A			,			unk_token=__A			,			sep_token=__A			,			cls_token=__A			,			pad_token=__A			,			mask_token=__A			,			add_prefix_space=__A			,			**__A			,			)

				with open(__A			,			encoding="utf-8"		) as vocab_handle:
							UpperCAmelCase_  :				int      =      json.load(__A		)
				UpperCAmelCase_  :				Optional[Any]      =      {v: k for k, v in self.encoder.items()}
				UpperCAmelCase_  :				Any      =      errors  # how to handle errors in decoding
				UpperCAmelCase_  :				List[Any]      =      bytes_to_unicode()
				UpperCAmelCase_  :				Optional[int]      =      {v: k for k, v in self.byte_encoder.items()}
				with open(__A			,			encoding="utf-8"		) as merges_handle:
							UpperCAmelCase_  :				List[Any]      =      merges_handle.read().split("\n"		)[1:-1]
				UpperCAmelCase_  :				int      =      [tuple(merge.split()		) for merge in bpe_merges]
				UpperCAmelCase_  :				int      =      dict(zip(__A			,			range(len(__A		)		)		)		)
				UpperCAmelCase_  :				str      =      {}
				UpperCAmelCase_  :				Dict      =      add_prefix_space

				# Should have added re.IGNORECASE so BPE merges can happen for capitalized versions of contractions
				UpperCAmelCase_  :				Any      =      re.compile(R"'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+"		)





	@property
	def   _SCREAMING_SNAKE_CASE   (   self      :				List[Any]		)		->    Dict:
				return len(self.encoder		)





	def   _SCREAMING_SNAKE_CASE   (   self      :				Optional[Any]		)		->    List[Any]:
				return dict(self.encoder			,			**self.added_tokens_encoder		)





	def   _SCREAMING_SNAKE_CASE   (   self      :				Dict			,			lowerCAmelCase_      :				List[Any]		)		->    int:
				if token in self.cache:
							return self.cache[token]
				UpperCAmelCase_  :				int      =      tuple(__A		)
				UpperCAmelCase_  :				Union[str, Any]      =      get_pairs(__A		)

				if not pairs:
							return token

				while True:
							UpperCAmelCase_  :				Any      =      min(__A			,			key=lambda lowerCAmelCase_		: self.bpe_ranks.get(__A			,			float("inf"		)		)		)
							if bigram not in self.bpe_ranks:
										break
							UpperCAmelCase_  :				int      =      bigram
							UpperCAmelCase_  :				List[Any]      =      []
							UpperCAmelCase_  :				Dict      =      0
							while i < len(__A		):
										try:
													UpperCAmelCase_  :				int      =      word.index(__A			,			__A		)
										except ValueError:
													new_word.extend(word[i:]		)
													break
										else:
													new_word.extend(word[i:j]		)
													UpperCAmelCase_  :				List[Any]      =      j

										if word[i] == first and i < len(__A		) - 1 and word[i + 1] == second:
													new_word.append(first + second		)
													i += 2
										else:
													new_word.append(word[i]		)
													i += 1
							UpperCAmelCase_  :				Optional[Any]      =      tuple(__A		)
							UpperCAmelCase_  :				int      =      new_word
							if len(__A		) == 1:
										break
							else:
										UpperCAmelCase_  :				Tuple      =      get_pairs(__A		)
				UpperCAmelCase_  :				Tuple      =      " ".join(__A		)
				UpperCAmelCase_  :				Optional[Any]      =      word
				return word





	def   _SCREAMING_SNAKE_CASE   (   self      :				Union[str, Any]			,			lowerCAmelCase_      :				Tuple		)		->    Union[str, Any]:
				UpperCAmelCase_  :				int      =      []
				for token in re.findall(self.pat			,			__A		):
							UpperCAmelCase_  :				int      =      "".join(
							    self.byte_encoder[b] for b in token.encode("utf-8"		)		)  # Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)
							bpe_tokens.extend(bpe_token for bpe_token in self.bpe(__A		).split(" "		)		)
				return bpe_tokens





	def   _SCREAMING_SNAKE_CASE   (   self      :				Union[str, Any]			,			lowerCAmelCase_      :				Tuple		)		->    List[str]:
				return self.encoder.get(__A			,			self.encoder.get(self.unk_token		)		)





	def   _SCREAMING_SNAKE_CASE   (   self      :				Optional[int]			,			lowerCAmelCase_      :				int		)		->    Union[str, Any]:
				return self.decoder.get(__A		)





	def   _SCREAMING_SNAKE_CASE   (   self      :				Optional[Any]			,			lowerCAmelCase_      :				int		)		->    Optional[int]:
				UpperCAmelCase_  :				Tuple      =      "".join(__A		)
				UpperCAmelCase_  :				Optional[int]      =      bytearray([self.byte_decoder[c] for c in text]		).decode("utf-8"			,			errors=self.errors		)
				return text





	def   _SCREAMING_SNAKE_CASE   (   self      :				int			,			lowerCAmelCase_      :				str			,			lowerCAmelCase_      :				Optional[str] = None		)		->    Dict:
				if not os.path.isdir(__A		):
							logger.error(f"""Vocabulary path ({save_directory}) should be a directory"""		)
							return
				UpperCAmelCase_  :				Optional[Any]      =      os.path.join(
				    __A			,			(filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]		)
				UpperCAmelCase_  :				List[Any]      =      os.path.join(
				    __A			,			(filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["merges_file"]		)

				with open(__A			,			"w"			,			encoding="utf-8"		) as f:
							f.write(json.dumps(self.encoder			,			indent=2			,			sort_keys=__A			,			ensure_ascii=__A		) + "\n"		)

				UpperCAmelCase_  :				Any      =      0
				with open(__A			,			"w"			,			encoding="utf-8"		) as writer:
							writer.write("#version: 0.2\n"		)
							for bpe_tokens, token_index in sorted(self.bpe_ranks.items()			,			key=lambda lowerCAmelCase_		: kv[1]		):
										if index != token_index:
													logger.warning(
													    f"""Saving vocabulary to {merge_file}: BPE merge indices are not consecutive."""
													    " Please check that the tokenizer is not corrupted!"		)
													UpperCAmelCase_  :				List[Any]      =      token_index
										writer.write(" ".join(__A		) + "\n"		)
										index += 1

				return vocab_file, merge_file





	def   _SCREAMING_SNAKE_CASE   (   self      :				List[str]			,			lowerCAmelCase_      :				List[int]			,			lowerCAmelCase_      :				Optional[List[int]] = None		)		->    Union[str, Any]:
				if token_ids_a is None:
							return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
				UpperCAmelCase_  :				int      =      [self.cls_token_id]
				UpperCAmelCase_  :				Dict      =      [self.sep_token_id]
				return cls + token_ids_a + sep + sep + token_ids_a + sep





	def   _SCREAMING_SNAKE_CASE   (   self      :				Optional[Any]			,			lowerCAmelCase_      :				List[int]			,			lowerCAmelCase_      :				Optional[List[int]] = None			,			lowerCAmelCase_      :				bool = False		)		->    Tuple:
				if already_has_special_tokens:
							return super().get_special_tokens_mask(
							    token_ids_a=__A			,			token_ids_a=__A			,			already_has_special_tokens=__A		)

				if token_ids_a is None:
							return [1] + ([0] * len(__A		)) + [1]
				return [1] + ([0] * len(__A		)) + [1, 1] + ([0] * len(__A		)) + [1]





	def   _SCREAMING_SNAKE_CASE   (   self      :				Any			,			lowerCAmelCase_      :				List[int]			,			lowerCAmelCase_      :				Optional[List[int]] = None		)		->    Optional[Any]:
				UpperCAmelCase_  :				Optional[Any]      =      [self.sep_token_id]
				UpperCAmelCase_  :				Any      =      [self.cls_token_id]

				if token_ids_a is None:
							return len(cls + token_ids_a + sep		) * [0]
				return len(cls + token_ids_a + sep + sep + token_ids_a + sep		) * [0]





	def   _SCREAMING_SNAKE_CASE   (   self      :				Tuple			,			lowerCAmelCase_      :				Dict			,			lowerCAmelCase_      :				Any=False			,			**lowerCAmelCase_      :				Union[str, Any]		)		->    Any:
				UpperCAmelCase_  :				Any      =      kwargs.pop("add_prefix_space"			,			self.add_prefix_space		)
				if (is_split_into_words or add_prefix_space) and (len(__A		) > 0 and not text[0].isspace()):
							UpperCAmelCase_  :				List[Any]      =      " " + text
				return (text, kwargs)











"""simple docstring"""
import gc
import unittest

import numpy as np
import torch
from transformers import CLIPTextConfig, CLIPTextModelWithProjection, CLIPTokenizer

from diffusers import HeunDiscreteScheduler, PriorTransformer, ShapEPipeline
from diffusers.pipelines.shap_e import ShapERenderer
from diffusers.utils import load_numpy, slow
from diffusers.utils.testing_utils import require_torch_gpu, torch_device

from ..test_pipelines_common import PipelineTesterMixin, assert_mean_pixel_difference







class     UpperCamelCase_ (__A       ,		unittest.TestCase  ):
	__magic_name__			   =       ShapEPipeline
	__magic_name__			   =       ['''prompt''']
	__magic_name__			   =       ['''prompt''']
	__magic_name__			   =       [
	    '''num_images_per_prompt''',
	    '''num_inference_steps''',
	    '''generator''',
	    '''latents''',
	    '''guidance_scale''',
	    '''frame_size''',
	    '''output_type''',
	    '''return_dict''',
	]
	__magic_name__			   =       False





	@property
	def   _SCREAMING_SNAKE_CASE   (   self      :				Union[str, Any]		)		->    Dict:
				return 32





	@property
	def   _SCREAMING_SNAKE_CASE   (   self      :				List[str]		)		->    Tuple:
				return 32





	@property
	def   _SCREAMING_SNAKE_CASE   (   self      :				List[Any]		)		->    Optional[int]:
				return self.time_input_dim * 4





	@property
	def   _SCREAMING_SNAKE_CASE   (   self      :				Union[str, Any]		)		->    List[Any]:
				return 8





	@property
	def   _SCREAMING_SNAKE_CASE   (   self      :				Dict		)		->    int:
				UpperCAmelCase_  :				str      =      CLIPTokenizer.from_pretrained("hf-internal-testing/tiny-random-clip"		)
				return tokenizer





	@property
	def   _SCREAMING_SNAKE_CASE   (   self      :				Union[str, Any]		)		->    List[str]:
				torch.manual_seed(0		)
				UpperCAmelCase_  :				Dict      =      CLIPTextConfig(
				    bos_token_id=0			,			eos_token_id=2			,			hidden_size=self.text_embedder_hidden_size			,			projection_dim=self.text_embedder_hidden_size			,			intermediate_size=37			,			layer_norm_eps=1e-05			,			num_attention_heads=4			,			num_hidden_layers=5			,			pad_token_id=1			,			vocab_size=1_000			,			)
				return CLIPTextModelWithProjection(lowerCAmelCase_		)





	@property
	def   _SCREAMING_SNAKE_CASE   (   self      :				Dict		)		->    Optional[Any]:
				torch.manual_seed(0		)

				UpperCAmelCase_  :				str      =      {
				    "num_attention_heads": 2,
				    "attention_head_dim": 16,
				    "embedding_dim": self.time_input_dim,
				    "num_embeddings": 32,
				    "embedding_proj_dim": self.text_embedder_hidden_size,
				    "time_embed_dim": self.time_embed_dim,
				    "num_layers": 1,
				    "clip_embed_dim": self.time_input_dim * 2,
				    "additional_embeddings": 0,
				    "time_embed_act_fn": "gelu",
				    "norm_in_type": "layer",
				    "encoder_hid_proj_type": None,
				    "added_emb_type": None,
				}

				UpperCAmelCase_  :				List[Any]      =      PriorTransformer(**lowerCAmelCase_		)
				return model





	@property
	def   _SCREAMING_SNAKE_CASE   (   self      :				Optional[Any]		)		->    int:
				torch.manual_seed(0		)

				UpperCAmelCase_  :				Any      =      {
				    "param_shapes": (
				        (self.renderer_dim, 93),
				        (self.renderer_dim, 8),
				        (self.renderer_dim, 8),
				        (self.renderer_dim, 8),
				    ),
				    "d_latent": self.time_input_dim,
				    "d_hidden": self.renderer_dim,
				    "n_output": 12,
				    "background": (
				        0.1,
				        0.1,
				        0.1,
				    ),
				}
				UpperCAmelCase_  :				Tuple      =      ShapERenderer(**lowerCAmelCase_		)
				return model





	def   _SCREAMING_SNAKE_CASE   (   self      :				List[str]		)		->    Tuple:
				UpperCAmelCase_  :				str      =      self.dummy_prior
				UpperCAmelCase_  :				Dict      =      self.dummy_text_encoder
				UpperCAmelCase_  :				Any      =      self.dummy_tokenizer
				UpperCAmelCase_  :				int      =      self.dummy_renderer

				UpperCAmelCase_  :				Optional[int]      =      HeunDiscreteScheduler(
				    beta_schedule="exp"			,			num_train_timesteps=1_024			,			prediction_type="sample"			,			use_karras_sigmas=lowerCAmelCase_			,			clip_sample=lowerCAmelCase_			,			clip_sample_range=1.0			,			)
				UpperCAmelCase_  :				str      =      {
				    "prior": prior,
				    "text_encoder": text_encoder,
				    "tokenizer": tokenizer,
				    "renderer": renderer,
				    "scheduler": scheduler,
				}

				return components





	def   _SCREAMING_SNAKE_CASE   (   self      :				Any			,			lowerCAmelCase_      :				int			,			lowerCAmelCase_      :				Any=0		)		->    Union[str, Any]:
				if str(lowerCAmelCase_		).startswith("mps"		):
							UpperCAmelCase_  :				str      =      torch.manual_seed(lowerCAmelCase_		)
				else:
							UpperCAmelCase_  :				Union[str, Any]      =      torch.Generator(device=lowerCAmelCase_		).manual_seed(lowerCAmelCase_		)
				UpperCAmelCase_  :				List[Any]      =      {
				    "prompt": "horse",
				    "generator": generator,
				    "num_inference_steps": 1,
				    "frame_size": 32,
				    "output_type": "np",
				}
				return inputs





	def   _SCREAMING_SNAKE_CASE   (   self      :				str		)		->    List[Any]:
				UpperCAmelCase_  :				Any      =      "cpu"

				UpperCAmelCase_  :				Union[str, Any]      =      self.get_dummy_components()

				UpperCAmelCase_  :				Tuple      =      self.pipeline_class(**lowerCAmelCase_		)
				UpperCAmelCase_  :				Union[str, Any]      =      pipe.to(lowerCAmelCase_		)

				pipe.set_progress_bar_config(disable=lowerCAmelCase_		)

				UpperCAmelCase_  :				int      =      pipe(**self.get_dummy_inputs(lowerCAmelCase_		)		)
				UpperCAmelCase_  :				Dict      =      output.images[0]
				UpperCAmelCase_  :				Any      =      image[0, -3:, -3:, -1]

				assert image.shape == (20, 32, 32, 3)

				UpperCAmelCase_  :				Optional[int]      =      np.array(
				    [
				        0.0_0_0_3_9_2_1_6,
				        0.0_0_0_3_9_2_1_6,
				        0.0_0_0_3_9_2_1_6,
				        0.0_0_0_3_9_2_1_6,
				        0.0_0_0_3_9_2_1_6,
				        0.0_0_0_3_9_2_1_6,
				        0.0_0_0_3_9_2_1_6,
				        0.0_0_0_3_9_2_1_6,
				        0.0_0_0_3_9_2_1_6,
				    ]		)

				assert np.abs(image_slice.flatten() - expected_slice		).max() < 1e-2





	def   _SCREAMING_SNAKE_CASE   (   self      :				List[str]		)		->    Optional[Any]:
				# NOTE: Larger batch sizes cause this test to timeout, only test on smaller batches
				self._test_inference_batch_consistent(batch_sizes=[1, 2]		)





	def   _SCREAMING_SNAKE_CASE   (   self      :				int		)		->    List[str]:
				UpperCAmelCase_  :				Optional[Any]      =      torch_device == "cpu"
				UpperCAmelCase_  :				Dict      =      True

				self._test_inference_batch_single_identical(
				    batch_size=2			,			test_max_difference=lowerCAmelCase_			,			relax_max_difference=lowerCAmelCase_			,			)





	def   _SCREAMING_SNAKE_CASE   (   self      :				Any		)		->    List[str]:
				UpperCAmelCase_  :				int      =      self.get_dummy_components()
				UpperCAmelCase_  :				Tuple      =      self.pipeline_class(**lowerCAmelCase_		)
				UpperCAmelCase_  :				List[str]      =      pipe.to(lowerCAmelCase_		)
				pipe.set_progress_bar_config(disable=lowerCAmelCase_		)

				UpperCAmelCase_  :				List[str]      =      1
				UpperCAmelCase_  :				List[Any]      =      2

				UpperCAmelCase_  :				int      =      self.get_dummy_inputs(lowerCAmelCase_		)

				for key in inputs.keys():
							if key in self.batch_params:
										UpperCAmelCase_  :				int      =      batch_size * [inputs[key]]

				UpperCAmelCase_  :				int      =      pipe(**lowerCAmelCase_			,			num_images_per_prompt=lowerCAmelCase_		)[0]

				assert images.shape[0] == batch_size * num_images_per_prompt







@slow
@require_torch_gpu
class     UpperCamelCase_ (unittest.TestCase  ):





	def   _SCREAMING_SNAKE_CASE   (   self      :				Union[str, Any]		)		->    Any:
				# clean up the VRAM after each test
				super().tearDown()
				gc.collect()
				torch.cuda.empty_cache()





	def   _SCREAMING_SNAKE_CASE   (   self      :				str		)		->    Union[str, Any]:
				UpperCAmelCase_  :				Any      =      load_numpy(
				    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
				    "/shap_e/test_shap_e_np_out.npy"		)
				UpperCAmelCase_  :				str      =      ShapEPipeline.from_pretrained("openai/shap-e"		)
				UpperCAmelCase_  :				Union[str, Any]      =      pipe.to(lowerCAmelCase_		)
				pipe.set_progress_bar_config(disable=lowerCAmelCase_		)

				UpperCAmelCase_  :				Union[str, Any]      =      torch.Generator(device=lowerCAmelCase_		).manual_seed(0		)

				UpperCAmelCase_  :				Optional[int]      =      pipe(
				    "a shark"			,			generator=lowerCAmelCase_			,			guidance_scale=1_5.0			,			num_inference_steps=64			,			frame_size=64			,			output_type="np"			,			).images[0]

				assert images.shape == (20, 64, 64, 3)

				assert_mean_pixel_difference(lowerCAmelCase_			,			lowerCAmelCase_		)



