





import unittest

import numpy as np
import timeout_decorator  # noqa

from transformers import BlenderbotSmallConfig, is_flax_available
from transformers.testing_utils import require_flax, slow

from ...generation.test_flax_utils import FlaxGenerationTesterMixin
from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor


if is_flax_available():
      import os

      # The slow tests are often failing with OOM error on GPU
      # This makes JAX allocate exactly what is needed on demand, and deallocate memory that is no longer needed
      # but will be slower as stated here https://jax.readthedocs.io/en/latest/gpu_memory_allocation.html
      snake_case								=							"platform"

      import jax
      import jax.numpy as jnp

      from transformers.models.blenderbot_small.modeling_flax_blenderbot_small import (
          FlaxBlenderbotSmallForConditionalGeneration,
          FlaxBlenderbotSmallModel,
          shift_tokens_right,
      )

def 				SCREAMING_SNAKE_CASE__							(	snake_case__	:int      ,				snake_case__	:Dict      ,				snake_case__	:Union[str, Any]=None      ,				snake_case__	:List[Any]=None      ,				snake_case__	:Dict=None      ,				snake_case__	:Any=None      ,				snake_case__	:Dict=None      ,				snake_case__	:Optional[Any]=None      ,				)   ->    Union[str, Any]:







  if attention_mask is None:
    _lowercase						    =			np.where(input_ids != config.pad_token_id      ,				1      ,				0  )
  if decoder_attention_mask is None:
    _lowercase						    =			np.where(decoder_input_ids != config.pad_token_id      ,				1      ,				0  )
  if head_mask is None:
    _lowercase						    =			np.ones((config.encoder_layers, config.encoder_attention_heads)  )
  if decoder_head_mask is None:
    _lowercase						    =			np.ones((config.decoder_layers, config.decoder_attention_heads)  )
  if cross_attn_head_mask is None:
    _lowercase						    =			np.ones((config.decoder_layers, config.decoder_attention_heads)  )
  return {
      "input_ids": input_ids,
      "decoder_input_ids": decoder_input_ids,
      "attention_mask": attention_mask,
      "decoder_attention_mask": attention_mask,
  }





class 					A_					:







       """simple docstring"""





       def __init__(     self						:						Optional[Any]    ,__A						:						Tuple    ,__A						:						Union[str, Any]=13    ,__A						:						Dict=7    ,__A						:						str=True    ,__A						:						int=False    ,__A						:						List[str]=99    ,__A						:						Any=16    ,__A						:						Union[str, Any]=2    ,__A						:						str=4    ,__A						:						List[Any]=4    ,__A						:						Optional[Any]="gelu"    ,__A						:						Any=0.1    ,__A						:						Any=0.1    ,__A						:						Union[str, Any]=32    ,__A						:						Union[str, Any]=2    ,__A						:						Tuple=1    ,__A						:						int=0    ,__A						:						Optional[Any]=0.02    ,)    ->       Optional[int]:
         _lowercase						    =			parent
         _lowercase						    =			batch_size
         _lowercase						    =			seq_length
         _lowercase						    =			is_training
         _lowercase						    =			use_labels
         _lowercase						    =			vocab_size
         _lowercase						    =			hidden_size
         _lowercase						    =			num_hidden_layers
         _lowercase						    =			num_attention_heads
         _lowercase						    =			intermediate_size
         _lowercase						    =			hidden_act
         _lowercase						    =			hidden_dropout_prob
         _lowercase						    =			attention_probs_dropout_prob
         _lowercase						    =			max_position_embeddings
         _lowercase						    =			eos_token_id
         _lowercase						    =			pad_token_id
         _lowercase						    =			bos_token_id
         _lowercase						    =			initializer_range







       def  __UpperCAmelCase			(     self						:						Optional[Any]	)    ->       Optional[Any]:
         _lowercase						    =			np.clip(ids_tensor([self.batch_size, self.seq_length - 1]    ,self.vocab_size	)    ,3    ,self.vocab_size	)
         _lowercase						    =			np.concatenate((input_ids, 2 * np.ones((self.batch_size, 1)    ,dtype=np.intaa	))    ,-1	)

         _lowercase						    =			shift_tokens_right(a__    ,1    ,2	)

         _lowercase						    =			BlenderbotSmallConfig(
             vocab_size=self.vocab_size    ,d_model=self.hidden_size    ,encoder_layers=self.num_hidden_layers    ,decoder_layers=self.num_hidden_layers    ,encoder_attention_heads=self.num_attention_heads    ,decoder_attention_heads=self.num_attention_heads    ,encoder_ffn_dim=self.intermediate_size    ,decoder_ffn_dim=self.intermediate_size    ,dropout=self.hidden_dropout_prob    ,attention_dropout=self.attention_probs_dropout_prob    ,max_position_embeddings=self.max_position_embeddings    ,eos_token_id=self.eos_token_id    ,bos_token_id=self.bos_token_id    ,pad_token_id=self.pad_token_id    ,initializer_range=self.initializer_range    ,use_cache=a__    ,)
         _lowercase						    =			prepare_blenderbot_inputs_dict(a__    ,a__    ,a__	)
         return config, inputs_dict







       def  __UpperCAmelCase			(     self						:						Optional[int]	)    ->       Any:
         _lowercase    ,		_lowercase						    =			self.prepare_config_and_inputs()
         return config, inputs_dict







       def  __UpperCAmelCase			(     self						:						int    ,__A						:						Tuple    ,__A						:						List[Any]    ,__A						:						List[str]	)    ->       Union[str, Any]:
         _lowercase						    =			20
         _lowercase						    =			model_class_name(a__	)

         _lowercase						    =			model.encode(inputs_dict['input_ids']	)

         _lowercase    ,		_lowercase						    =			(
             inputs_dict['decoder_input_ids'],
             inputs_dict['decoder_attention_mask'],
         )

         _lowercase						    =			model.init_cache(decoder_input_ids.shape[0]    ,a__    ,a__	)
         _lowercase						    =			jnp.ones((decoder_input_ids.shape[0], max_decoder_length)    ,dtype='i4'	)

         _lowercase						    =			jnp.broadcast_to(
             jnp.arange(decoder_input_ids.shape[-1] - 1	)[None, :]    ,(decoder_input_ids.shape[0], decoder_input_ids.shape[-1] - 1)    ,)
         _lowercase						    =			model.decode(
             decoder_input_ids[:, :-1]    ,a__    ,decoder_attention_mask=a__    ,past_key_values=a__    ,decoder_position_ids=a__    ,)

         _lowercase						    =			jnp.array(decoder_input_ids.shape[0] * [[decoder_input_ids.shape[-1] - 1]]    ,dtype='i4'	)
         _lowercase						    =			model.decode(
             decoder_input_ids[:, -1:]    ,a__    ,decoder_attention_mask=a__    ,past_key_values=outputs_cache.past_key_values    ,decoder_position_ids=a__    ,)

         _lowercase						    =			model.decode(a__    ,a__	)

         _lowercase						    =			np.max(np.abs((outputs_cache_next[0][:, -1, :5] - outputs[0][:, -1, :5])	)	)
         self.parent.assertTrue(diff < 1e-3    ,msg=F"""Max diff is {diff}"""	)







       def  __UpperCAmelCase			(     self						:						Any    ,__A						:						int    ,__A						:						List[str]    ,__A						:						List[Any]	)    ->       int:
         _lowercase						    =			20
         _lowercase						    =			model_class_name(a__	)

         _lowercase						    =			model.encode(inputs_dict['input_ids']	)

         _lowercase    ,		_lowercase						    =			(
             inputs_dict['decoder_input_ids'],
             inputs_dict['decoder_attention_mask'],
         )

         _lowercase						    =			jnp.concatenate(
             [
                 decoder_attention_mask,
                 jnp.zeros((decoder_attention_mask.shape[0], max_decoder_length - decoder_attention_mask.shape[1])	),
             ]    ,axis=-1    ,)

         _lowercase						    =			model.init_cache(decoder_input_ids.shape[0]    ,a__    ,a__	)
         _lowercase						    =			jnp.broadcast_to(
             jnp.arange(decoder_input_ids.shape[-1] - 1	)[None, :]    ,(decoder_input_ids.shape[0], decoder_input_ids.shape[-1] - 1)    ,)

         _lowercase						    =			model.decode(
             decoder_input_ids[:, :-1]    ,a__    ,decoder_attention_mask=a__    ,past_key_values=a__    ,decoder_position_ids=a__    ,)
         _lowercase						    =			jnp.array(decoder_input_ids.shape[0] * [[decoder_input_ids.shape[-1] - 1]]    ,dtype='i4'	)
         _lowercase						    =			model.decode(
             decoder_input_ids[:, -1:]    ,a__    ,past_key_values=outputs_cache.past_key_values    ,decoder_attention_mask=a__    ,decoder_position_ids=a__    ,)

         _lowercase						    =			model.decode(a__    ,a__    ,decoder_attention_mask=a__	)

         _lowercase						    =			np.max(np.abs((outputs_cache_next[0][:, -1, :5] - outputs[0][:, -1, :5])	)	)
         self.parent.assertTrue(diff < 1e-3    ,msg=F"""Max diff is {diff}"""	)





@require_flax
class 					A_					(   unittest.TestCase						):







       """simple docstring"""





       SCREAMING_SNAKE_CASE_   :			Optional[Any]  			=	9_9







       def  __UpperCAmelCase			(     self						:						Union[str, Any]	)    ->       List[str]:
         _lowercase						    =			np.array(
             [
                 [71, 82, 18, 33, 46, 91, 2],
                 [68, 34, 26, 58, 30, 82, 2],
                 [5, 97, 17, 39, 94, 40, 2],
                 [76, 83, 94, 25, 70, 78, 2],
                 [87, 59, 41, 35, 48, 66, 2],
                 [55, 13, 16, 58, 5, 2, 1],  # note padding
                 [64, 27, 31, 51, 12, 75, 2],
                 [52, 64, 86, 17, 83, 39, 2],
                 [48, 61, 9, 24, 71, 82, 2],
                 [26, 1, 60, 48, 22, 13, 2],
                 [21, 5, 62, 28, 14, 76, 2],
                 [45, 98, 37, 86, 59, 48, 2],
                 [70, 70, 50, 9, 28, 0, 2],
             ]    ,dtype=np.intaa    ,)

         _lowercase						    =			input_ids.shape[0]
         _lowercase						    =			BlenderbotSmallConfig(
             vocab_size=self.vocab_size    ,d_model=24    ,encoder_layers=2    ,decoder_layers=2    ,encoder_attention_heads=2    ,decoder_attention_heads=2    ,encoder_ffn_dim=32    ,decoder_ffn_dim=32    ,max_position_embeddings=48    ,eos_token_id=2    ,pad_token_id=1    ,bos_token_id=0    ,)
         return config, input_ids, batch_size







       def  __UpperCAmelCase			(     self						:						int	)    ->       Dict:
         _lowercase    ,		_lowercase    ,		_lowercase						    =			self._get_config_and_data()
         _lowercase						    =			FlaxBlenderbotSmallForConditionalGeneration(a__	)
         _lowercase						    =			lm_model(input_ids=a__	)
         _lowercase						    =			(batch_size, input_ids.shape[1], config.vocab_size)
         self.assertEqual(outputs['logits'].shape    ,a__	)







       def  __UpperCAmelCase			(     self						:						Tuple	)    ->       Any:
         _lowercase						    =			BlenderbotSmallConfig(
             vocab_size=self.vocab_size    ,d_model=14    ,encoder_layers=2    ,decoder_layers=2    ,encoder_attention_heads=2    ,decoder_attention_heads=2    ,encoder_ffn_dim=8    ,decoder_ffn_dim=8    ,max_position_embeddings=48    ,)
         _lowercase						    =			FlaxBlenderbotSmallForConditionalGeneration(a__	)
         _lowercase						    =			np.array([[71, 82, 18, 33, 46, 91, 2], [68, 34, 26, 58, 30, 2, 1]]    ,dtype=np.intaa	)
         _lowercase						    =			np.array([[82, 71, 82, 18, 2], [58, 68, 2, 1, 1]]    ,dtype=np.intaa	)
         _lowercase						    =			lm_model(input_ids=a__    ,decoder_input_ids=a__	)
         _lowercase						    =			(*summary.shape, config.vocab_size)
         self.assertEqual(outputs['logits'].shape    ,a__	)







       def  __UpperCAmelCase			(     self						:						Optional[int]	)    ->       List[str]:
         _lowercase						    =			np.array([[71, 82, 18, 33, 2, 1, 1], [68, 34, 26, 58, 30, 82, 2]]    ,dtype=np.intaa	)
         _lowercase						    =			shift_tokens_right(a__    ,1    ,2	)
         _lowercase						    =			np.equal(a__    ,1	).astype(np.floataa	).sum()
         _lowercase						    =			np.equal(a__    ,1	).astype(np.floataa	).sum()
         self.assertEqual(shifted.shape    ,input_ids.shape	)
         self.assertEqual(a__    ,n_pad_before - 1	)
         self.assertTrue(np.equal(shifted[:, 0]    ,2	).all()	)





@require_flax
class 					A_					(   __snake_case       ,						unittest.TestCase       ,						__snake_case						):







       """simple docstring"""





       SCREAMING_SNAKE_CASE_   :			List[str]  			=	True
       SCREAMING_SNAKE_CASE_   :			Union[str, Any]  			=	(
           (
               FlaxBlenderbotSmallModel,
               FlaxBlenderbotSmallForConditionalGeneration,
           )
           if is_flax_available()
           else ()
       )
       SCREAMING_SNAKE_CASE_   :			Optional[Any]  			=	(FlaxBlenderbotSmallForConditionalGeneration,) if is_flax_available() else ()







       def  __UpperCAmelCase			(     self						:						Tuple	)    ->       Union[str, Any]:
         _lowercase						    =			FlaxBlenderbotSmallModelTester(self	)







       def  __UpperCAmelCase			(     self						:						str	)    ->       Dict:
         _lowercase    ,		_lowercase						    =			self.model_tester.prepare_config_and_inputs()
         for model_class in self.all_model_classes:
           self.model_tester.check_use_cache_forward(a__    ,a__    ,a__	)







       def  __UpperCAmelCase			(     self						:						Any	)    ->       int:
         _lowercase    ,		_lowercase						    =			self.model_tester.prepare_config_and_inputs()
         for model_class in self.all_model_classes:
           self.model_tester.check_use_cache_forward_with_attn_mask(a__    ,a__    ,a__	)







       def  __UpperCAmelCase			(     self						:						str	)    ->       Any:
         _lowercase    ,		_lowercase						    =			self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
           with self.subTest(model_class.__name__	):
             _lowercase						    =			self._prepare_for_class(a__    ,a__	)
             _lowercase						    =			model_class(a__	)

             @jax.jit
             def encode_jitted(__A						:						Optional[int]    ,__A						:						Optional[int]=None    ,**__A						:						int	):
               return model.encode(input_ids=a__    ,attention_mask=a__	)

             with self.subTest('JIT Enabled'	):
               _lowercase						    =			encode_jitted(**a__	).to_tuple()

             with self.subTest('JIT Disabled'	):
               with jax.disable_jit():
                 _lowercase						    =			encode_jitted(**a__	).to_tuple()

             self.assertEqual(len(a__	)    ,len(a__	)	)
             for jitted_output, output in zip(a__    ,a__	):
               self.assertEqual(jitted_output.shape    ,output.shape	)







       def  __UpperCAmelCase			(     self						:						Optional[int]	)    ->       List[Any]:
         _lowercase    ,		_lowercase						    =			self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
           with self.subTest(model_class.__name__	):
             _lowercase						    =			model_class(a__	)
             _lowercase						    =			model.encode(inputs_dict['input_ids']    ,inputs_dict['attention_mask']	)

             _lowercase						    =			{
                 'decoder_input_ids': inputs_dict['decoder_input_ids'],
                 'decoder_attention_mask': inputs_dict['decoder_attention_mask'],
                 'encoder_outputs': encoder_outputs,
             }

             @jax.jit
             def decode_jitted(__A						:						List[str]    ,__A						:						List[Any]    ,__A						:						Optional[Any]	):
               return model.decode(
                   decoder_input_ids=a__    ,decoder_attention_mask=a__    ,encoder_outputs=a__    ,)

             with self.subTest('JIT Enabled'	):
               _lowercase						    =			decode_jitted(**a__	).to_tuple()

             with self.subTest('JIT Disabled'	):
               with jax.disable_jit():
                 _lowercase						    =			decode_jitted(**a__	).to_tuple()

             self.assertEqual(len(a__	)    ,len(a__	)	)
             for jitted_output, output in zip(a__    ,a__	):
               self.assertEqual(jitted_output.shape    ,output.shape	)







       @slow
       def  __UpperCAmelCase			(     self						:						Optional[int]	)    ->       Union[str, Any]:
         for model_class_name in self.all_model_classes:
           _lowercase						    =			model_class_name.from_pretrained('facebook/blenderbot_small-90M'	)
           # FlaxBlenderbotForSequenceClassification expects eos token in input_ids
           _lowercase						    =			np.ones((1, 1)	) * model.config.eos_token_id
           _lowercase						    =			model(a__	)
           self.assertIsNotNone(a__	)



import gc
import unittest

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

from diffusers import (
    AutoencoderKL,
    DDIMScheduler,
    StableDiffusionAttendAndExcitePipeline,
    UNetaDConditionModel,
)
from diffusers.utils import load_numpy, skip_mps, slow
from diffusers.utils.testing_utils import require_torch_gpu

from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
from ..test_pipelines_common import PipelineKarrasSchedulerTesterMixin, PipelineLatentTesterMixin, PipelineTesterMixin


_lowercase							:   Optional[int]						=						False






@skip_mps
class    _UpperCamelCase     (       __snake_case     ,		__snake_case     ,		__snake_case     ,		unittest.TestCase					):

				"""simple docstring"""







				lowerCAmelCase					=			StableDiffusionAttendAndExcitePipeline
				lowerCAmelCase					=			False
				lowerCAmelCase					=			TEXT_TO_IMAGE_PARAMS
				lowerCAmelCase					=			TEXT_TO_IMAGE_BATCH_PARAMS.union({'token_indices'}					)
				lowerCAmelCase					=			TEXT_TO_IMAGE_IMAGE_PARAMS
				lowerCAmelCase					=			TEXT_TO_IMAGE_IMAGE_PARAMS

				@classmethod
				def   _UpperCAmelCase       (    cls )						->					List[Any]:
					super().setUpClass()
					torch.use_deterministic_algorithms(a__ )

				@classmethod
				def   _UpperCAmelCase       (    cls )						->					Tuple:
					super().tearDownClass()
					torch.use_deterministic_algorithms(a__ )

				def   _UpperCAmelCase       (    self )						->					Dict:
					torch.manual_seed(0 )
					A             =					UNetaDConditionModel(
					    block_out_channels=(32, 64)					, layers_per_block=1					, sample_size=32					, in_channels=4					, out_channels=4					, down_block_types=("""DownBlock2D""", """CrossAttnDownBlock2D""")					, up_block_types=("""CrossAttnUpBlock2D""", """UpBlock2D""")					, cross_attention_dim=32					, attention_head_dim=(2, 4)					, use_linear_projection=a__					, )
					A             =					DDIMScheduler(
					    beta_start=0.0_00_85					, beta_end=0.0_12					, beta_schedule="""scaled_linear"""					, clip_sample=a__					, set_alpha_to_one=a__					, )
					torch.manual_seed(0 )
					A             =					AutoencoderKL(
					    block_out_channels=[32, 64]					, in_channels=3					, out_channels=3					, down_block_types=["""DownEncoderBlock2D""", """DownEncoderBlock2D"""]					, up_block_types=["""UpDecoderBlock2D""", """UpDecoderBlock2D"""]					, latent_channels=4					, sample_size=128					, )
					torch.manual_seed(0 )
					A             =					CLIPTextConfig(
					    bos_token_id=0					, eos_token_id=2					, hidden_size=32					, intermediate_size=37					, layer_norm_eps=1e-05					, num_attention_heads=4					, num_hidden_layers=5					, pad_token_id=1					, vocab_size=1000					, hidden_act="""gelu"""					, projection_dim=512					, )
					A             =					CLIPTextModel(a__ )
					A             =					CLIPTokenizer.from_pretrained("""hf-internal-testing/tiny-random-clip""" )

					A             =					{
					    """unet""": unet,
					    """scheduler""": scheduler,
					    """vae""": vae,
					    """text_encoder""": text_encoder,
					    """tokenizer""": tokenizer,
					    """safety_checker""": None,
					    """feature_extractor""": None,
					}

					return components

				def   _UpperCAmelCase       (    self					, a__					, a__=0 )						->					Optional[Any]:
					if str(a__ ).startswith("""mps""" ):
						A             =					torch.manual_seed(a__ )
					else:
						A             =					torch.Generator(device=a__ ).manual_seed(a__ )
					A             =					A             =					{
					    """prompt""": """a cat and a frog""",
					    """token_indices""": [2, 5],
					    """generator""": generator,
					    """num_inference_steps""": 1,
					    """guidance_scale""": 6.0,
					    """output_type""": """numpy""",
					    """max_iter_to_alter""": 2,
					    """thresholds""": {0: 0.7},
					}
					return inputs

				def   _UpperCAmelCase       (    self )						->					Union[str, Any]:
					A             =					"""cpu"""

					A             =					self.get_dummy_components()
					A             =					self.pipeline_class(**a__ )
					pipe.to(a__ )
					pipe.set_progress_bar_config(disable=a__ )

					A             =					self.get_dummy_inputs(a__ )
					A             =					pipe(**a__ ).images
					A             =					image[0, -3:, -3:, -1]

					self.assertEqual(image.shape					, (1, 64, 64, 3) )
					A             =					np.array(
					    [0.63_90_53_64, 0.62_89_73_07, 0.48_59_90_17, 0.5_13_36_24, 0.5_55_00_48, 0.45_76_95_16, 0.50_32_69_73, 0.5_02_31_39, 0.45_38_44_96] )
					A             =					np.abs(image_slice.flatten() - expected_slice ).max()
					self.assertLessEqual(a__					, 1e-3 )

				def   _UpperCAmelCase       (    self )						->					List[Any]:
					super().test_cpu_offload_forward_pass(expected_max_diff=5e-4 )

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

				def   _UpperCAmelCase       (    self )						->					Any:
					self._test_inference_batch_single_identical(batch_size=2					, expected_max_diff=7e-4 )

				def   _UpperCAmelCase       (    self )						->					Optional[Any]:
					super().test_dict_tuple_outputs_equivalent(expected_max_difference=3e-3 )

				def   _UpperCAmelCase       (    self )						->					str:
					super().test_pt_np_pil_outputs_equivalent(expected_max_diff=5e-4 )

				def   _UpperCAmelCase       (    self )						->					int:
					super().test_save_load_local(expected_max_difference=5e-4 )

				def   _UpperCAmelCase       (    self )						->					Optional[Any]:
					super().test_save_load_optional_components(expected_max_difference=4e-4 )






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

				"""simple docstring"""







				@classmethod
				def   _UpperCAmelCase       (    cls )						->					Tuple:
					super().setUpClass()
					torch.use_deterministic_algorithms(a__ )

				@classmethod
				def   _UpperCAmelCase       (    cls )						->					Dict:
					super().tearDownClass()
					torch.use_deterministic_algorithms(a__ )

				def   _UpperCAmelCase       (    self )						->					Optional[Any]:
					super().tearDown()
					gc.collect()
					torch.cuda.empty_cache()

				def   _UpperCAmelCase       (    self )						->					int:
					A             =					torch.manual_seed(51 )

					A             =					StableDiffusionAttendAndExcitePipeline.from_pretrained(
					    """CompVis/stable-diffusion-v1-4"""					, safety_checker=a__					, torch_dtype=torch.floataa )
					pipe.to("""cuda""" )

					A             =					"""a painting of an elephant with glasses"""
					A             =					[5, 7]

					A             =					pipe(
					    prompt=a__					, token_indices=a__					, guidance_scale=7.5					, generator=a__					, num_inference_steps=5					, max_iter_to_alter=5					, output_type="""numpy"""					, ).images[0]

					A             =					load_numpy(
					    """https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/attend-and-excite/elephant_glasses.npy""" )
					assert np.abs((expected_image - image).max() ) < 5e-1



