


import os
import unittest

from transformers import ElectraTokenizerFast
from transformers.models.electra.tokenization_electra import (
    VOCAB_FILES_NAMES,
    BasicTokenizer,
    ElectraTokenizer,
    WordpieceTokenizer,
    _is_control,
    _is_punctuation,
    _is_whitespace,
)
from transformers.testing_utils import require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin, filter_non_english





@require_tokenizers
class 			lowerCAmelCase__(     snake_case__     ,     unittest.TestCase    ):






    '''simple docstring'''





    A_	:  int								=			ElectraTokenizer
    A_	:  Tuple								=			ElectraTokenizerFast
    A_	:  Optional[int]								=			True
    A_	:  Optional[Any]								=			True
    A_	:  str								=			filter_non_english





    def        _lowerCamelCase			(						self					: Union[str, Any]						):





       '''simple docstring'''
       super().setUp()

       UpperCAmelCase_				:   int							= [
           '''[UNK]''',
           '''[CLS]''',
           '''[SEP]''',
           '''[PAD]''',
           '''[MASK]''',
           '''want''',
           '''##want''',
           '''##ed''',
           '''wa''',
           '''un''',
           '''runn''',
           '''##ing''',
           ''',''',
           '''low''',
           '''lowest''',
       ]
       UpperCAmelCase_				:   Tuple							= os.path.join(self.tmpdirname							, VOCAB_FILES_NAMES['''vocab_file''']						)
       with open(self.vocab_file							, '''w'''							, encoding='''utf-8'''						) as vocab_writer:
          vocab_writer.write(''''''.join([x + '''\n''' for x in vocab_tokens]						)						)





    def        _lowerCamelCase			(						self					: Union[str, Any]							, __snake_case					: List[str]						):





       '''simple docstring'''
       UpperCAmelCase_				:   Union[str, Any]							= '''UNwant\u00E9d,running'''
       UpperCAmelCase_				:   Union[str, Any]							= '''unwanted, running'''
       return input_text, output_text





    def        _lowerCamelCase			(						self					: List[Any]						):





       '''simple docstring'''
       UpperCAmelCase_				:   Optional[int]							= self.tokenizer_class(self.vocab_file						)

       UpperCAmelCase_				:   Any							= tokenizer.tokenize('''UNwant\u00E9d,running'''						)
       self.assertListEqual(__snake_case							, ['''un''', '''##want''', '''##ed''', ''',''', '''runn''', '''##ing''']						)
       self.assertListEqual(tokenizer.convert_tokens_to_ids(__snake_case						)							, [9, 6, 7, 12, 10, 11]						)





    def        _lowerCamelCase			(						self					: List[Any]						):





       '''simple docstring'''
       if not self.test_rust_tokenizer:
          return

       UpperCAmelCase_				:   Optional[Any]							= self.get_tokenizer()
       UpperCAmelCase_				:   str							= self.get_rust_tokenizer()

       UpperCAmelCase_				:   Any							= '''UNwant\u00E9d,running'''

       UpperCAmelCase_				:   Optional[int]							= tokenizer.tokenize(__snake_case						)
       UpperCAmelCase_				:   List[Any]							= rust_tokenizer.tokenize(__snake_case						)
       self.assertListEqual(__snake_case							, __snake_case						)

       UpperCAmelCase_				:   List[Any]							= tokenizer.encode(__snake_case							, add_special_tokens=__snake_case						)
       UpperCAmelCase_				:   Optional[Any]							= rust_tokenizer.encode(__snake_case							, add_special_tokens=__snake_case						)
       self.assertListEqual(__snake_case							, __snake_case						)

       UpperCAmelCase_				:   Optional[int]							= self.get_rust_tokenizer()
       UpperCAmelCase_				:   List[Any]							= tokenizer.encode(__snake_case						)
       UpperCAmelCase_				:   Optional[int]							= rust_tokenizer.encode(__snake_case						)
       self.assertListEqual(__snake_case							, __snake_case						)

       # With lower casing
       UpperCAmelCase_				:   List[Any]							= self.get_tokenizer(do_lower_case=__snake_case						)
       UpperCAmelCase_				:   Dict							= self.get_rust_tokenizer(do_lower_case=__snake_case						)

       UpperCAmelCase_				:   Dict							= '''UNwant\u00E9d,running'''

       UpperCAmelCase_				:   Optional[Any]							= tokenizer.tokenize(__snake_case						)
       UpperCAmelCase_				:   Optional[Any]							= rust_tokenizer.tokenize(__snake_case						)
       self.assertListEqual(__snake_case							, __snake_case						)

       UpperCAmelCase_				:   Optional[int]							= tokenizer.encode(__snake_case							, add_special_tokens=__snake_case						)
       UpperCAmelCase_				:   str							= rust_tokenizer.encode(__snake_case							, add_special_tokens=__snake_case						)
       self.assertListEqual(__snake_case							, __snake_case						)

       UpperCAmelCase_				:   int							= self.get_rust_tokenizer()
       UpperCAmelCase_				:   Dict							= tokenizer.encode(__snake_case						)
       UpperCAmelCase_				:   Union[str, Any]							= rust_tokenizer.encode(__snake_case						)
       self.assertListEqual(__snake_case							, __snake_case						)





    def        _lowerCamelCase			(						self					: Union[str, Any]						):





       '''simple docstring'''
       UpperCAmelCase_				:   int							= BasicTokenizer()

       self.assertListEqual(tokenizer.tokenize('''ah\u535A\u63A8zz'''						)							, ['''ah''', '''\u535A''', '''\u63A8''', '''zz''']						)





    def        _lowerCamelCase			(						self					: Union[str, Any]						):





       '''simple docstring'''
       UpperCAmelCase_				:   int							= BasicTokenizer(do_lower_case=__snake_case						)

       self.assertListEqual(
           tokenizer.tokenize(''' \tHeLLo!how  \n Are yoU?  '''						)							, ['''hello''', '''!''', '''how''', '''are''', '''you''', '''?''']						)
       self.assertListEqual(tokenizer.tokenize('''H\u00E9llo'''						)							, ['''hello''']						)





    def        _lowerCamelCase			(						self					: Any						):





       '''simple docstring'''
       UpperCAmelCase_				:   List[str]							= BasicTokenizer(do_lower_case=__snake_case							, strip_accents=__snake_case						)

       self.assertListEqual(
           tokenizer.tokenize(''' \tHäLLo!how  \n Are yoU?  '''						)							, ['''hällo''', '''!''', '''how''', '''are''', '''you''', '''?''']						)
       self.assertListEqual(tokenizer.tokenize('''H\u00E9llo'''						)							, ['''h\u00E9llo''']						)





    def        _lowerCamelCase			(						self					: List[Any]						):





       '''simple docstring'''
       UpperCAmelCase_				:   Any							= BasicTokenizer(do_lower_case=__snake_case							, strip_accents=__snake_case						)

       self.assertListEqual(
           tokenizer.tokenize(''' \tHäLLo!how  \n Are yoU?  '''						)							, ['''hallo''', '''!''', '''how''', '''are''', '''you''', '''?''']						)
       self.assertListEqual(tokenizer.tokenize('''H\u00E9llo'''						)							, ['''hello''']						)





    def        _lowerCamelCase			(						self					: List[str]						):





       '''simple docstring'''
       UpperCAmelCase_				:   Any							= BasicTokenizer(do_lower_case=__snake_case						)

       self.assertListEqual(
           tokenizer.tokenize(''' \tHäLLo!how  \n Are yoU?  '''						)							, ['''hallo''', '''!''', '''how''', '''are''', '''you''', '''?''']						)
       self.assertListEqual(tokenizer.tokenize('''H\u00E9llo'''						)							, ['''hello''']						)





    def        _lowerCamelCase			(						self					: Tuple						):





       '''simple docstring'''
       UpperCAmelCase_				:   str							= BasicTokenizer(do_lower_case=__snake_case						)

       self.assertListEqual(
           tokenizer.tokenize(''' \tHeLLo!how  \n Are yoU?  '''						)							, ['''HeLLo''', '''!''', '''how''', '''Are''', '''yoU''', '''?''']						)





    def        _lowerCamelCase			(						self					: Optional[Any]						):





       '''simple docstring'''
       UpperCAmelCase_				:   List[Any]							= BasicTokenizer(do_lower_case=__snake_case							, strip_accents=__snake_case						)

       self.assertListEqual(
           tokenizer.tokenize(''' \tHäLLo!how  \n Are yoU?  '''						)							, ['''HäLLo''', '''!''', '''how''', '''Are''', '''yoU''', '''?''']						)





    def        _lowerCamelCase			(						self					: int						):





       '''simple docstring'''
       UpperCAmelCase_				:   int							= BasicTokenizer(do_lower_case=__snake_case							, strip_accents=__snake_case						)

       self.assertListEqual(
           tokenizer.tokenize(''' \tHäLLo!how  \n Are yoU?  '''						)							, ['''HaLLo''', '''!''', '''how''', '''Are''', '''yoU''', '''?''']						)





    def        _lowerCamelCase			(						self					: int						):





       '''simple docstring'''
       UpperCAmelCase_				:   Any							= BasicTokenizer(do_lower_case=__snake_case							, never_split=['''[UNK]''']						)

       self.assertListEqual(
           tokenizer.tokenize(''' \tHeLLo!how  \n Are yoU? [UNK]'''						)							, ['''HeLLo''', '''!''', '''how''', '''Are''', '''yoU''', '''?''', '''[UNK]''']						)





    def        _lowerCamelCase			(						self					: List[str]						):





       '''simple docstring'''
       UpperCAmelCase_				:   Tuple							= ['''[UNK]''', '''[CLS]''', '''[SEP]''', '''want''', '''##want''', '''##ed''', '''wa''', '''un''', '''runn''', '''##ing''']

       UpperCAmelCase_				:   Optional[int]							= {}
       for i, token in enumerate(__snake_case						):
          UpperCAmelCase_				:   Tuple							= i
       UpperCAmelCase_				:   Optional[Any]							= WordpieceTokenizer(vocab=__snake_case							, unk_token='''[UNK]'''						)

       self.assertListEqual(tokenizer.tokenize(''''''						)							, []						)

       self.assertListEqual(tokenizer.tokenize('''unwanted running'''						)							, ['''un''', '''##want''', '''##ed''', '''runn''', '''##ing''']						)

       self.assertListEqual(tokenizer.tokenize('''unwantedX running'''						)							, ['''[UNK]''', '''runn''', '''##ing''']						)





    def        _lowerCamelCase			(						self					: Dict						):





       '''simple docstring'''
       self.assertTrue(_is_whitespace(''' '''						)						)
       self.assertTrue(_is_whitespace('''\t'''						)						)
       self.assertTrue(_is_whitespace('''\r'''						)						)
       self.assertTrue(_is_whitespace('''\n'''						)						)
       self.assertTrue(_is_whitespace('''\u00A0'''						)						)

       self.assertFalse(_is_whitespace('''A'''						)						)
       self.assertFalse(_is_whitespace('''-'''						)						)





    def        _lowerCamelCase			(						self					: Dict						):





       '''simple docstring'''
       self.assertTrue(_is_control('''\u0005'''						)						)

       self.assertFalse(_is_control('''A'''						)						)
       self.assertFalse(_is_control(''' '''						)						)
       self.assertFalse(_is_control('''\t'''						)						)
       self.assertFalse(_is_control('''\r'''						)						)





    def        _lowerCamelCase			(						self					: List[Any]						):





       '''simple docstring'''
       self.assertTrue(_is_punctuation('''-'''						)						)
       self.assertTrue(_is_punctuation('''$'''						)						)
       self.assertTrue(_is_punctuation('''`'''						)						)
       self.assertTrue(_is_punctuation('''.'''						)						)

       self.assertFalse(_is_punctuation('''A'''						)						)
       self.assertFalse(_is_punctuation(''' '''						)						)





    def        _lowerCamelCase			(						self					: List[Any]						):





       '''simple docstring'''
       UpperCAmelCase_				:   List[str]							= self.get_tokenizer()
       UpperCAmelCase_				:   Any							= self.get_rust_tokenizer()

       # Example taken from the issue https://github.com/huggingface/tokenizers/issues/340
       self.assertListEqual([tokenizer.tokenize(__snake_case						) for t in ['''Test''', '''\xad''', '''test''']]							, [['''[UNK]'''], [], ['''[UNK]''']]						)

       self.assertListEqual(
           [rust_tokenizer.tokenize(__snake_case						) for t in ['''Test''', '''\xad''', '''test''']]							, [['''[UNK]'''], [], ['''[UNK]''']]						)





    @slow
    def        _lowerCamelCase			(						self					: Any						):





       '''simple docstring'''
       UpperCAmelCase_				:   Union[str, Any]							= self.tokenizer_class.from_pretrained('''google/electra-base-discriminator'''						)

       UpperCAmelCase_				:   int							= tokenizer.encode('''sequence builders'''							, add_special_tokens=__snake_case						)
       UpperCAmelCase_				:   Optional[int]							= tokenizer.encode('''multi-sequence build'''							, add_special_tokens=__snake_case						)

       UpperCAmelCase_				:   Optional[Any]							= tokenizer.build_inputs_with_special_tokens(__snake_case						)
       UpperCAmelCase_				:   Union[str, Any]							= tokenizer.build_inputs_with_special_tokens(__snake_case							, __snake_case						)

       assert encoded_sentence == [101] + text + [102]
       assert encoded_pair == [101] + text + [102] + text_a + [102]





    def        _lowerCamelCase			(						self					: str						):





       '''simple docstring'''
       for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
          with self.subTest(f'''{tokenizer.__class__.__name__} ({pretrained_name})'''						):
             UpperCAmelCase_				:   Tuple							= self.rust_tokenizer_class.from_pretrained(__snake_case							, **__snake_case						)

             UpperCAmelCase_				:   Any							= f'''A, naïve {tokenizer_r.mask_token} AllenNLP sentence.'''
             UpperCAmelCase_				:   List[Any]							= tokenizer_r.encode_plus(
                 __snake_case							, return_attention_mask=__snake_case							, return_token_type_ids=__snake_case							, return_offsets_mapping=__snake_case							, add_special_tokens=__snake_case							, )

             UpperCAmelCase_				:   Tuple							= tokenizer_r.do_lower_case if hasattr(__snake_case							, '''do_lower_case'''						) else False
             UpperCAmelCase_				:   str							= (
                 [
                     ((0, 0), tokenizer_r.cls_token),
                     ((0, 1), '''A'''),
                     ((1, 2), ''','''),
                     ((3, 5), '''na'''),
                     ((5, 6), '''##ï'''),
                     ((6, 8), '''##ve'''),
                     ((9, 15), tokenizer_r.mask_token),
                     ((16, 21), '''Allen'''),
                     ((21, 23), '''##NL'''),
                     ((23, 24), '''##P'''),
                     ((25, 33), '''sentence'''),
                     ((33, 34), '''.'''),
                     ((0, 0), tokenizer_r.sep_token),
                 ]
                 if not do_lower_case
                 else [
                     ((0, 0), tokenizer_r.cls_token),
                     ((0, 1), '''a'''),
                     ((1, 2), ''','''),
                     ((3, 8), '''naive'''),
                     ((9, 15), tokenizer_r.mask_token),
                     ((16, 21), '''allen'''),
                     ((21, 23), '''##nl'''),
                     ((23, 24), '''##p'''),
                     ((25, 33), '''sentence'''),
                     ((33, 34), '''.'''),
                     ((0, 0), tokenizer_r.sep_token),
                 ]
             )

             self.assertEqual(
                 [e[1] for e in expected_results]							, tokenizer_r.convert_ids_to_tokens(tokens['''input_ids''']						)						)
             self.assertEqual([e[0] for e in expected_results]							, tokens['''offset_mapping''']						)





    def        _lowerCamelCase			(						self					: str						):





       '''simple docstring'''
       UpperCAmelCase_				:   Tuple							= ['''的''', '''人''', '''有''']
       UpperCAmelCase_				:   Union[str, Any]							= ''''''.join(__snake_case						)
       for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
          with self.subTest(f'''{tokenizer.__class__.__name__} ({pretrained_name})'''						):
             UpperCAmelCase_				:   List[Any]							= True
             UpperCAmelCase_				:   Tuple							= self.tokenizer_class.from_pretrained(__snake_case							, **__snake_case						)
             UpperCAmelCase_				:   List[Any]							= self.rust_tokenizer_class.from_pretrained(__snake_case							, **__snake_case						)

             UpperCAmelCase_				:   Any							= tokenizer_p.encode(__snake_case							, add_special_tokens=__snake_case						)
             UpperCAmelCase_				:   Optional[int]							= tokenizer_r.encode(__snake_case							, add_special_tokens=__snake_case						)

             UpperCAmelCase_				:   str							= tokenizer_r.convert_ids_to_tokens(__snake_case						)
             UpperCAmelCase_				:   Dict							= tokenizer_p.convert_ids_to_tokens(__snake_case						)

             # it is expected that each Chinese character is not preceded by "##"
             self.assertListEqual(__snake_case							, __snake_case						)
             self.assertListEqual(__snake_case							, __snake_case						)

             UpperCAmelCase_				:   str							= False
             UpperCAmelCase_				:   int							= self.rust_tokenizer_class.from_pretrained(__snake_case							, **__snake_case						)
             UpperCAmelCase_				:   Any							= self.tokenizer_class.from_pretrained(__snake_case							, **__snake_case						)

             UpperCAmelCase_				:   Optional[int]							= tokenizer_r.encode(__snake_case							, add_special_tokens=__snake_case						)
             UpperCAmelCase_				:   Union[str, Any]							= tokenizer_p.encode(__snake_case							, add_special_tokens=__snake_case						)

             UpperCAmelCase_				:   Union[str, Any]							= tokenizer_r.convert_ids_to_tokens(__snake_case						)
             UpperCAmelCase_				:   List[str]							= tokenizer_p.convert_ids_to_tokens(__snake_case						)

             # it is expected that only the first Chinese character is not preceded by "##".
             UpperCAmelCase_				:   int							= [
                 f'''##{token}''' if idx != 0 else token for idx, token in enumerate(__snake_case						)
             ]
             self.assertListEqual(__snake_case							, __snake_case						)
             self.assertListEqual(__snake_case							, __snake_case						)



import gc
import unittest

import numpy as np
import torch

from diffusers import RePaintPipeline, RePaintScheduler, UNetaDModel
from diffusers.utils.testing_utils import (
    enable_full_determinism,
    load_image,
    load_numpy,
    nightly,
    require_torch_gpu,
    skip_mps,
    torch_device,
)

from ..pipeline_params import IMAGE_INPAINTING_BATCH_PARAMS, IMAGE_INPAINTING_PARAMS
from ..test_pipelines_common import PipelineTesterMixin


enable_full_determinism()





class 			lowerCAmelCase__(     snake_case__     ,     unittest.TestCase    ):






    '''simple docstring'''





    A_	:  Tuple								=			RePaintPipeline
    A_	:  Tuple								=			IMAGE_INPAINTING_PARAMS - {'width', 'height', 'guidance_scale'}
    A_	:  str								=			PipelineTesterMixin.required_optional_params - {
        'latents',
        'num_images_per_prompt',
        'callback',
        'callback_steps',
    }
    A_	:  Optional[Any]								=			IMAGE_INPAINTING_BATCH_PARAMS
    A_	:  Union[str, Any]								=			False





    def        _lowerCamelCase			(						self					: Any						):





       '''simple docstring'''
       torch.manual_seed(0						)
       torch.manual_seed(0						)
       UpperCAmelCase_				:   int							= UNetaDModel(
           block_out_channels=(32, 64)							, layers_per_block=2							, sample_size=32							, in_channels=3							, out_channels=3							, down_block_types=('''DownBlock2D''', '''AttnDownBlock2D''')							, up_block_types=('''AttnUpBlock2D''', '''UpBlock2D''')							, )
       UpperCAmelCase_				:   str							= RePaintScheduler()
       UpperCAmelCase_				:   Optional[Any]							= {'''unet''': unet, '''scheduler''': scheduler}
       return components





    def        _lowerCamelCase			(						self					: List[str]							, __snake_case					: Optional[Any]							, __snake_case					: int=0						):





       '''simple docstring'''
       if str(__snake_case						).startswith('''mps'''						):
          UpperCAmelCase_				:   Optional[Any]							= torch.manual_seed(__snake_case						)
       else:
          UpperCAmelCase_				:   Optional[Any]							= torch.Generator(device=__snake_case						).manual_seed(__snake_case						)
       UpperCAmelCase_				:   Optional[Any]							= np.random.RandomState(__snake_case						).standard_normal((1, 3, 32, 32)						)
       UpperCAmelCase_				:   Optional[int]							= torch.from_numpy(__snake_case						).to(device=__snake_case							, dtype=torch.floataa						)
       UpperCAmelCase_				:   Any							= (image > 0).to(device=__snake_case							, dtype=torch.floataa						)
       UpperCAmelCase_				:   List[str]							= {
           '''image''': image,
           '''mask_image''': mask,
           '''generator''': generator,
           '''num_inference_steps''': 5,
           '''eta''': 0.0,
           '''jump_length''': 2,
           '''jump_n_sample''': 2,
           '''output_type''': '''numpy''',
       }
       return inputs





    def        _lowerCamelCase			(						self					: Union[str, Any]						):





       '''simple docstring'''
       UpperCAmelCase_				:   str							= '''cpu'''  # ensure determinism for the device-dependent torch.Generator
       UpperCAmelCase_				:   Optional[int]							= self.get_dummy_components()
       UpperCAmelCase_				:   Dict							= RePaintPipeline(**__snake_case						)
       UpperCAmelCase_				:   int							= sd_pipe.to(__snake_case						)
       sd_pipe.set_progress_bar_config(disable=__snake_case						)

       UpperCAmelCase_				:   List[Any]							= self.get_dummy_inputs(__snake_case						)
       UpperCAmelCase_				:   Union[str, Any]							= sd_pipe(**__snake_case						).images
       UpperCAmelCase_				:   Optional[Any]							= image[0, -3:, -3:, -1]

       assert image.shape == (1, 32, 32, 3)
       UpperCAmelCase_				:   Tuple							= np.array([1.0_000, 0.5_426, 0.5_497, 0.2_200, 1.0_000, 1.0_000, 0.5_623, 1.0_000, 0.6_274]						)

       assert np.abs(image_slice.flatten() - expected_slice						).max() < 1E-3





    @skip_mps
    def        _lowerCamelCase			(						self					: Optional[int]						):





       '''simple docstring'''
       return super().test_save_load_local()





    @unittest.skip('''non-deterministic pipeline'''						)
    def        _lowerCamelCase			(						self					: Optional[Any]						):





       '''simple docstring'''
       return super().test_inference_batch_single_identical()





    @skip_mps
    def        _lowerCamelCase			(						self					: Dict						):





       '''simple docstring'''
       return super().test_dict_tuple_outputs_equivalent()





    @skip_mps
    def        _lowerCamelCase			(						self					: int						):





       '''simple docstring'''
       return super().test_save_load_optional_components()





    @skip_mps
    def        _lowerCamelCase			(						self					: Union[str, Any]						):





       '''simple docstring'''
       return super().test_attention_slicing_forward_pass()





@nightly
@require_torch_gpu
class 			lowerCAmelCase__(     unittest.TestCase    ):






    '''simple docstring'''





    def        _lowerCamelCase			(						self					: Tuple						):





       '''simple docstring'''
       super().tearDown()
       gc.collect()
       torch.cuda.empty_cache()





    def        _lowerCamelCase			(						self					: List[str]						):





       '''simple docstring'''
       UpperCAmelCase_				:   List[Any]							= load_image(
           '''https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/'''
           '''repaint/celeba_hq_256.png'''						)
       UpperCAmelCase_				:   int							= load_image(
           '''https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/repaint/mask_256.png'''						)
       UpperCAmelCase_				:   List[Any]							= load_numpy(
           '''https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/'''
           '''repaint/celeba_hq_256_result.npy'''						)

       UpperCAmelCase_				:   List[str]							= '''google/ddpm-ema-celebahq-256'''
       UpperCAmelCase_				:   Union[str, Any]							= UNetaDModel.from_pretrained(__snake_case						)
       UpperCAmelCase_				:   Dict							= RePaintScheduler.from_pretrained(__snake_case						)

       UpperCAmelCase_				:   Optional[int]							= RePaintPipeline(unet=__snake_case							, scheduler=__snake_case						).to(__snake_case						)
       repaint.set_progress_bar_config(disable=__snake_case						)
       repaint.enable_attention_slicing()

       UpperCAmelCase_				:   Optional[int]							= torch.manual_seed(0						)
       UpperCAmelCase_				:   List[str]							= repaint(
           __snake_case							, __snake_case							, num_inference_steps=250							, eta=0.0							, jump_length=10							, jump_n_sample=10							, generator=__snake_case							, output_type='''np'''							, )
       UpperCAmelCase_				:   Tuple							= output.images[0]

       assert image.shape == (256, 256, 3)
       assert np.abs(expected_image - image						).mean() < 1E-2