





'''simple docstring'''

import gc
import unittest

import numpy as np
import torch
import torch.nn.functional as F
from transformers import (
    ClapTextConfig,
    ClapTextModelWithProjection,
    RobertaTokenizer,
    SpeechTaHifiGan,
    SpeechTaHifiGanConfig,
)

from diffusers import (
    AudioLDMPipeline,
    AutoencoderKL,
    DDIMScheduler,
    LMSDiscreteScheduler,
    PNDMScheduler,
    UNetaDConditionModel,
)
from diffusers.utils import is_xformers_available, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism

from ..pipeline_params import TEXT_TO_AUDIO_BATCH_PARAMS, TEXT_TO_AUDIO_PARAMS
from ..test_pipelines_common import PipelineTesterMixin


enable_full_determinism()






class        UpperCAmelCase     (	UpperCamelCase__      ,	unittest.TestCase    ):
 __lowercase       		=    AudioLDMPipeline
 __lowercase       		=    TEXT_TO_AUDIO_PARAMS
 __lowercase       		=    TEXT_TO_AUDIO_BATCH_PARAMS
 __lowercase       		=    frozenset(
     [
         """num_inference_steps""",
         """num_waveforms_per_prompt""",
         """generator""",
         """latents""",
         """output_type""",
         """return_dict""",
         """callback""",
         """callback_steps""",
     ]    )
 def 					UpperCAmelCase_							(    self				:List[Any]							)->							List[Any]:
     torch.manual_seed(0							)
     A__    =      UNetaDConditionModel(
         block_out_channels=(32, 64)						,	layers_per_block=2						,	sample_size=32						,	in_channels=4						,	out_channels=4						,	down_block_types=("DownBlock2D", "CrossAttnDownBlock2D")						,	up_block_types=("CrossAttnUpBlock2D", "UpBlock2D")						,	cross_attention_dim=(32, 64)						,	class_embed_type="simple_projection"						,	projection_class_embeddings_input_dim=32						,	class_embeddings_concat=lowercase_						,	)
     A__    =      DDIMScheduler(
         beta_start=0.0_0_0_8_5						,	beta_end=0.0_1_2						,	beta_schedule="scaled_linear"						,	clip_sample=lowercase_						,	set_alpha_to_one=lowercase_						,	)
     torch.manual_seed(0							)
     A__    =      AutoencoderKL(
         block_out_channels=[32, 64]						,	in_channels=1						,	out_channels=1						,	down_block_types=["DownEncoderBlock2D", "DownEncoderBlock2D"]						,	up_block_types=["UpDecoderBlock2D", "UpDecoderBlock2D"]						,	latent_channels=4						,	)
     torch.manual_seed(0							)
     A__    =      ClapTextConfig(
         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=10_00						,	projection_dim=32						,	)
     A__    =      ClapTextModelWithProjection(lowercase_							)
     A__    =      RobertaTokenizer.from_pretrained("hf-internal-testing/tiny-random-roberta"						,	model_max_length=77							)

     A__    =      SpeechTaHifiGanConfig(
         model_in_dim=8						,	sampling_rate=1_60_00						,	upsample_initial_channel=16						,	upsample_rates=[2, 2]						,	upsample_kernel_sizes=[4, 4]						,	resblock_kernel_sizes=[3, 7]						,	resblock_dilation_sizes=[[1, 3, 5], [1, 3, 5]]						,	normalize_before=lowercase_						,	)

     A__    =      SpeechTaHifiGan(lowercase_							)

     A__    =      {
         "unet": unet,
         "scheduler": scheduler,
         "vae": vae,
         "text_encoder": text_encoder,
         "tokenizer": tokenizer,
         "vocoder": vocoder,
     }
     return components
 def 					UpperCAmelCase_							(    self				:List[str]						,	lowercase_				:Union[str, Any]						,	lowercase_				:Tuple=0							)->							Dict:
     if str(lowercase_							).startswith("mps"							):
         A__    =      torch.manual_seed(lowercase_							)
     else:
         A__    =      torch.Generator(device=lowercase_							).manual_seed(lowercase_							)
     A__    =      {
         "prompt": "A hammer hitting a wooden surface",
         "generator": generator,
         "num_inference_steps": 2,
         "guidance_scale": 6.0,
     }
     return inputs
 def 					UpperCAmelCase_							(    self				:List[Any]							)->							Tuple:
     A__    =      "cpu"  # ensure determinism for the device-dependent torch.Generator

     A__    =      self.get_dummy_components()
     A__    =      AudioLDMPipeline(**lowercase_							)
     A__    =      audioldm_pipe.to(lowercase_							)
     audioldm_pipe.set_progress_bar_config(disable=lowercase_							)

     A__    =      self.get_dummy_inputs(lowercase_							)
     A__    =      audioldm_pipe(**lowercase_							)
     A__    =      output.audios[0]

     assert audio.ndim == 1
     assert len(lowercase_							) == 2_56

     A__    =      audio[:10]
     A__    =      np.array(
         [-0.0_0_5_0, 0.0_0_5_0, -0.0_0_6_0, 0.0_0_3_3, -0.0_0_2_6, 0.0_0_3_3, -0.0_0_2_7, 0.0_0_3_3, -0.0_0_2_8, 0.0_0_3_3]							)

     assert np.abs(audio_slice - expected_slice							).max() < 1E-2
 def 					UpperCAmelCase_							(    self				:Optional[int]							)->							Union[str, Any]:
     A__    =      self.get_dummy_components()
     A__    =      AudioLDMPipeline(**lowercase_							)
     A__    =      audioldm_pipe.to(lowercase_							)
     A__    =      audioldm_pipe.to(lowercase_							)
     audioldm_pipe.set_progress_bar_config(disable=lowercase_							)

     A__    =      self.get_dummy_inputs(lowercase_							)
     A__    =      3 * [inputs["prompt"]]

     # forward
     A__    =      audioldm_pipe(**lowercase_							)
     A__    =      output.audios[0]

     A__    =      self.get_dummy_inputs(lowercase_							)
     A__    =      3 * [inputs.pop("prompt"							)]

     A__    =      audioldm_pipe.tokenizer(
         lowercase_						,	padding="max_length"						,	max_length=audioldm_pipe.tokenizer.model_max_length						,	truncation=lowercase_						,	return_tensors="pt"						,	)
     A__    =      text_inputs["input_ids"].to(lowercase_							)

     A__    =      audioldm_pipe.text_encoder(
         lowercase_						,	)
     A__    =      prompt_embeds.text_embeds
     # additional L_2 normalization over each hidden-state
     A__    =      F.normalize(lowercase_						,	dim=-1							)

     A__    =      prompt_embeds

     # forward
     A__    =      audioldm_pipe(**lowercase_							)
     A__    =      output.audios[0]

     assert np.abs(audio_a - audio_a							).max() < 1E-2
 def 					UpperCAmelCase_							(    self				:Optional[int]							)->							int:
     A__    =      self.get_dummy_components()
     A__    =      AudioLDMPipeline(**lowercase_							)
     A__    =      audioldm_pipe.to(lowercase_							)
     A__    =      audioldm_pipe.to(lowercase_							)
     audioldm_pipe.set_progress_bar_config(disable=lowercase_							)

     A__    =      self.get_dummy_inputs(lowercase_							)
     A__    =      3 * ["this is a negative prompt"]
     A__    =      negative_prompt
     A__    =      3 * [inputs["prompt"]]

     # forward
     A__    =      audioldm_pipe(**lowercase_							)
     A__    =      output.audios[0]

     A__    =      self.get_dummy_inputs(lowercase_							)
     A__    =      3 * [inputs.pop("prompt"							)]

     A__    =      []
     for p in [prompt, negative_prompt]:
         A__    =      audioldm_pipe.tokenizer(
             lowercase_						,	padding="max_length"						,	max_length=audioldm_pipe.tokenizer.model_max_length						,	truncation=lowercase_						,	return_tensors="pt"						,	)
         A__    =      text_inputs["input_ids"].to(lowercase_							)

         A__    =      audioldm_pipe.text_encoder(
             lowercase_						,	)
         A__    =      text_embeds.text_embeds
         # additional L_2 normalization over each hidden-state
         A__    =      F.normalize(lowercase_						,	dim=-1							)

         embeds.append(lowercase_							)

     A__,     A__    =      embeds

     # forward
     A__    =      audioldm_pipe(**lowercase_							)
     A__    =      output.audios[0]

     assert np.abs(audio_a - audio_a							).max() < 1E-2
 def 					UpperCAmelCase_							(    self				:Optional[int]							)->							str:
     A__    =      "cpu"  # ensure determinism for the device-dependent torch.Generator
     A__    =      self.get_dummy_components()
     A__    =      PNDMScheduler(skip_prk_steps=lowercase_							)
     A__    =      AudioLDMPipeline(**lowercase_							)
     A__    =      audioldm_pipe.to(lowercase_							)
     audioldm_pipe.set_progress_bar_config(disable=lowercase_							)

     A__    =      self.get_dummy_inputs(lowercase_							)
     A__    =      "egg cracking"
     A__    =      audioldm_pipe(**lowercase_						,	negative_prompt=lowercase_							)
     A__    =      output.audios[0]

     assert audio.ndim == 1
     assert len(lowercase_							) == 2_56

     A__    =      audio[:10]
     A__    =      np.array(
         [-0.0_0_5_1, 0.0_0_5_0, -0.0_0_6_0, 0.0_0_3_4, -0.0_0_2_6, 0.0_0_3_3, -0.0_0_2_7, 0.0_0_3_3, -0.0_0_2_8, 0.0_0_3_2]							)

     assert np.abs(audio_slice - expected_slice							).max() < 1E-2
 def 					UpperCAmelCase_							(    self				:List[str]							)->							List[str]:
     A__    =      "cpu"  # ensure determinism for the device-dependent torch.Generator
     A__    =      self.get_dummy_components()
     A__    =      PNDMScheduler(skip_prk_steps=lowercase_							)
     A__    =      AudioLDMPipeline(**lowercase_							)
     A__    =      audioldm_pipe.to(lowercase_							)
     audioldm_pipe.set_progress_bar_config(disable=lowercase_							)

     A__    =      "A hammer hitting a wooden surface"

     # test num_waveforms_per_prompt=1 (default)
     A__    =      audioldm_pipe(lowercase_						,	num_inference_steps=2							).audios

     assert audios.shape == (1, 2_56)

     # test num_waveforms_per_prompt=1 (default) for batch of prompts
     A__    =      2
     A__    =      audioldm_pipe([prompt] * batch_size						,	num_inference_steps=2							).audios

     assert audios.shape == (batch_size, 2_56)

     # test num_waveforms_per_prompt for single prompt
     A__    =      2
     A__    =      audioldm_pipe(lowercase_						,	num_inference_steps=2						,	num_waveforms_per_prompt=lowercase_							).audios

     assert audios.shape == (num_waveforms_per_prompt, 2_56)

     # test num_waveforms_per_prompt for batch of prompts
     A__    =      2
     A__    =      audioldm_pipe(
         [prompt] * batch_size						,	num_inference_steps=2						,	num_waveforms_per_prompt=lowercase_							).audios

     assert audios.shape == (batch_size * num_waveforms_per_prompt, 2_56)
 def 					UpperCAmelCase_							(    self				:Optional[int]							)->							List[Any]:
     A__    =      "cpu"  # ensure determinism for the device-dependent torch.Generator
     A__    =      self.get_dummy_components()
     A__    =      AudioLDMPipeline(**lowercase_							)
     A__    =      audioldm_pipe.to(lowercase_							)
     audioldm_pipe.set_progress_bar_config(disable=lowercase_							)
     A__    =      audioldm_pipe.vocoder.config.sampling_rate

     A__    =      self.get_dummy_inputs(lowercase_							)
     A__    =      audioldm_pipe(audio_length_in_s=0.0_1_6						,	**lowercase_							)
     A__    =      output.audios[0]

     assert audio.ndim == 1
     assert len(lowercase_							) / vocoder_sampling_rate == 0.0_1_6

     A__    =      audioldm_pipe(audio_length_in_s=0.0_3_2						,	**lowercase_							)
     A__    =      output.audios[0]

     assert audio.ndim == 1
     assert len(lowercase_							) / vocoder_sampling_rate == 0.0_3_2
 def 					UpperCAmelCase_							(    self				:Union[str, Any]							)->							Dict:
     A__    =      self.get_dummy_components()
     A__    =      AudioLDMPipeline(**lowercase_							)
     A__    =      audioldm_pipe.to(lowercase_							)
     audioldm_pipe.set_progress_bar_config(disable=lowercase_							)

     A__    =      ["hey"]

     A__    =      audioldm_pipe(lowercase_						,	num_inference_steps=1							)
     A__    =      output.audios.shape
     assert audio_shape == (1, 2_56)

     A__    =      audioldm_pipe.vocoder.config
     config.model_in_dim *= 2
     A__    =      SpeechTaHifiGan(lowercase_							).to(lowercase_							)
     A__    =      audioldm_pipe(lowercase_						,	num_inference_steps=1							)
     A__    =      output.audios.shape
     # waveform shape is unchanged, we just have 2x the number of mel channels in the spectrogram
     assert audio_shape == (1, 2_56)
 def 					UpperCAmelCase_							(    self				:Any							)->							Optional[Any]:
     self._test_attention_slicing_forward_pass(test_mean_pixel_difference=lowercase_							)
 def 					UpperCAmelCase_							(    self				:int							)->							List[str]:
     self._test_inference_batch_single_identical(test_mean_pixel_difference=lowercase_							)



 @unittest.skipIf(
     torch_device != "cuda" or not is_xformers_available()						,	reason="XFormers attention is only available with CUDA and `xformers` installed"						,	)
 def 					UpperCAmelCase_							(    self				:Tuple							)->							Optional[Any]:
     self._test_xformers_attention_forwardGenerator_pass(test_mean_pixel_difference=lowercase_							)






@slow
class        UpperCAmelCase     (	unittest.TestCase    ):
 def 					UpperCAmelCase_							(    self				:Optional[int]							)->							int:
     super().tearDown()
     gc.collect()
     torch.cuda.empty_cache()
 def 					UpperCAmelCase_							(    self				:int						,	lowercase_				:List[Any]						,	lowercase_				:List[str]="cpu"						,	lowercase_				:Optional[int]=torch.floataa						,	lowercase_				:str=0							)->							Tuple:
     A__    =      torch.Generator(device=lowercase_							).manual_seed(lowercase_							)
     A__    =      np.random.RandomState(lowercase_							).standard_normal((1, 8, 1_28, 16)							)
     A__    =      torch.from_numpy(lowercase_							).to(device=lowercase_						,	dtype=lowercase_							)
     A__    =      {
         "prompt": "A hammer hitting a wooden surface",
         "latents": latents,
         "generator": generator,
         "num_inference_steps": 3,
         "guidance_scale": 2.5,
     }
     return inputs
 def 					UpperCAmelCase_							(    self				:Optional[Any]							)->							Optional[int]:
     A__    =      AudioLDMPipeline.from_pretrained("cvssp/audioldm"							)
     A__    =      audioldm_pipe.to(lowercase_							)
     audioldm_pipe.set_progress_bar_config(disable=lowercase_							)

     A__    =      self.get_inputs(lowercase_							)
     A__    =      25
     A__    =      audioldm_pipe(**lowercase_							).audios[0]

     assert audio.ndim == 1
     assert len(lowercase_							) == 8_19_20

     A__    =      audio[7_72_30:7_72_40]
     A__    =      np.array(
         [-0.4_8_8_4, -0.4_6_0_7, 0.0_0_2_3, 0.5_0_0_7, 0.5_8_9_6, 0.5_1_5_1, 0.3_8_1_3, -0.0_2_0_8, -0.3_6_8_7, -0.4_3_1_5]							)
     A__    =      np.abs(expected_slice - audio_slice							).max()
     assert max_diff < 1E-2



 def 					UpperCAmelCase_							(    self				:Any							)->							List[Any]:
     A__    =      AudioLDMPipeline.from_pretrained("cvssp/audioldm"							)
     A__    =      LMSDiscreteScheduler.from_config(audioldm_pipe.scheduler.config							)
     A__    =      audioldm_pipe.to(lowercase_							)
     audioldm_pipe.set_progress_bar_config(disable=lowercase_							)

     A__    =      self.get_inputs(lowercase_							)
     A__    =      audioldm_pipe(**lowercase_							).audios[0]

     assert audio.ndim == 1
     assert len(lowercase_							) == 8_19_20

     A__    =      audio[2_77_80:2_77_90]
     A__    =      np.array([-0.2_1_3_1, -0.0_8_7_3, -0.0_1_2_4, -0.0_1_8_9, 0.0_5_6_9, 0.1_3_7_3, 0.1_8_8_3, 0.2_8_8_6, 0.3_2_9_7, 0.2_2_1_2]							)
     A__    =      np.abs(expected_slice - audio_slice							).max()
     assert max_diff < 3E-2










'''simple docstring'''

import json
import os
import unittest

from transformers import CLIPTokenizer, CLIPTokenizerFast
from transformers.models.clip.tokenization_clip import VOCAB_FILES_NAMES
from transformers.testing_utils import require_ftfy, require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin






@require_tokenizers
class        UpperCAmelCase     (	UpperCamelCase__      ,	unittest.TestCase    ):
 __lowercase       		=    CLIPTokenizer
 __lowercase       		=    CLIPTokenizerFast
 __lowercase       		=    True
 __lowercase       		=    {}
 __lowercase       		=    False
 def 					UpperCAmelCase_							(    self				:Optional[int]							)->							Optional[Any]:
     super().setUp()

     # fmt: off
     A__    =      ["l", "o", "w", "e", "r", "s", "t", "i", "d", "n", "lo", "l</w>", "w</w>", "r</w>", "t</w>", "low</w>", "er</w>", "lowest</w>", "newer</w>", "wider", "<unk>", "<|startoftext|>", "<|endoftext|>"]
     # fmt: on
     A__    =      dict(zip(lowercase_						,	range(len(lowercase_							)							)							)							)
     A__    =      ["#version: 0.2", "l o", "lo w</w>", "e r</w>"]
     A__    =      {"unk_token": "<unk>"}

     A__    =      os.path.join(self.tmpdirname						,	VOCAB_FILES_NAMES["vocab_file"]							)
     A__    =      os.path.join(self.tmpdirname						,	VOCAB_FILES_NAMES["merges_file"]							)
     with open(self.vocab_file						,	"w"						,	encoding="utf-8"							) as fp:
         fp.write(json.dumps(lowercase_							) + "\n"							)
     with open(self.merges_file						,	"w"						,	encoding="utf-8"							) as fp:
         fp.write("\n".join(lowercase_							)							)
 def 					UpperCAmelCase_							(    self				:Optional[int]						,	**lowercase_				:List[str]							)->							str:
     kwargs.update(self.special_tokens_map							)
     return CLIPTokenizer.from_pretrained(self.tmpdirname						,	**lowercase_							)
 def 					UpperCAmelCase_							(    self				:Optional[int]						,	**lowercase_				:Optional[int]							)->							Tuple:
     kwargs.update(self.special_tokens_map							)
     return CLIPTokenizerFast.from_pretrained(self.tmpdirname						,	**lowercase_							)
 def 					UpperCAmelCase_							(    self				:Optional[int]						,	lowercase_				:List[Any]							)->							List[str]:
     A__    =      "lower newer"
     A__    =      "lower newer"
     return input_text, output_text
 def 					UpperCAmelCase_							(    self				:int							)->							List[str]:
     A__    =      CLIPTokenizer(self.vocab_file						,	self.merges_file						,	**self.special_tokens_map							)
     A__    =      "lower newer"
     A__    =      ["lo", "w", "er</w>", "n", "e", "w", "er</w>"]
     A__    =      tokenizer.tokenize(lowercase_							)
     self.assertListEqual(lowercase_						,	lowercase_							)

     A__    =      tokens + [tokenizer.unk_token]
     A__    =      [10, 2, 16, 9, 3, 2, 16, 20]
     self.assertListEqual(tokenizer.convert_tokens_to_ids(lowercase_							)						,	lowercase_							)
 @require_ftfy
 def 					UpperCAmelCase_							(    self				:Dict							)->							str:
     for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
         with self.subTest(F"{tokenizer.__class__.__name__} ({pretrained_name})"							):
             A__    =      self.tokenizer_class.from_pretrained(lowercase_						,	**lowercase_							)
             A__    =      self.rust_tokenizer_class.from_pretrained(lowercase_						,	**lowercase_							)

             A__    =      "A\n'll 11p223RF☆ho!!to?'d'd''d of a cat to-$''d."
             A__    =      tokenizer_s.tokenize(lowercase_							)
             A__    =      tokenizer_r.tokenize(lowercase_							)

             self.assertListEqual(lowercase_						,	lowercase_							)

             # Test that the tokenization is identical on an example containing a character (Latin Small Letter A
             # with Tilde) encoded in 2 different ways
             A__    =      "xa\u0303y" + " " + "x\xe3y"
             A__    =      tokenizer_s.tokenize(lowercase_							)
             A__    =      tokenizer_r.tokenize(lowercase_							)

             self.assertListEqual(lowercase_						,	lowercase_							)

             # Test that the tokenization is identical on unicode of space type
             A__    =      [
                 "\u0009",  # (horizontal tab, '\t')
                 "\u000B",  # (vertical tab)
                 "\u000C",  # (form feed)
                 "\u0020",  # (space, ' ')
                 "\u200E",  # (left-to-right mark):w
                 "\u200F",  # (right-to-left mark)
             ]
             for unicode_seq in spaces_unicodes:
                 A__    =      tokenizer_s.tokenize(lowercase_							)
                 A__    =      tokenizer_r.tokenize(lowercase_							)

                 self.assertListEqual(lowercase_						,	lowercase_							)

             # Test that the tokenization is identical on unicode of line break type
             A__    =      [
                 "\u000A",  # (line feed, '\n')
                 "\r\n",  # (carriage return and line feed, '\r\n')
                 "\u000D",  # (carriage return, '\r')
                 "\r",  # (carriage return, '\r')
                 "\u000D",  # (carriage return, '\r')
                 "\u2028",  # (line separator)
                 "\u2029",  # (paragraph separator)
                 # "\u0085", # (next line)
             ]

             # The tokenization is not identical for the character "\u0085" (next line). The slow version using ftfy transforms
             # it into the Horizontal Ellipsis character "…" ("\u2026") while the fast version transforms it into a
             # space (and thus into an empty list).

             for unicode_seq in line_break_unicodes:
                 A__    =      tokenizer_s.tokenize(lowercase_							)
                 A__    =      tokenizer_r.tokenize(lowercase_							)

                 self.assertListEqual(lowercase_						,	lowercase_							)
 def 					UpperCAmelCase_							(    self				:Optional[int]							)->							Optional[Any]:
     # Test which aims to verify that the offsets are well adapted to the argument `add_prefix_space`
     for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
         with self.subTest(F"{tokenizer.__class__.__name__} ({pretrained_name})"							):
             A__    =      "hello"  # `hello` is a token in the vocabulary of `pretrained_name`
             A__    =      F"{text_of_1_token} {text_of_1_token}"

             A__    =      self.rust_tokenizer_class.from_pretrained(
                 lowercase_						,	use_fast=lowercase_						,	)
             A__    =      tokenizer_r(lowercase_						,	return_offsets_mapping=lowercase_						,	add_special_tokens=lowercase_							)
             self.assertEqual(encoding.offset_mapping[0]						,	(0, len(lowercase_							))							)
             self.assertEqual(
                 encoding.offset_mapping[1]						,	(len(lowercase_							) + 1, len(lowercase_							) + 1 + len(lowercase_							))						,	)

             A__    =      F" {text}"

             A__    =      self.rust_tokenizer_class.from_pretrained(
                 lowercase_						,	use_fast=lowercase_						,	)
             A__    =      tokenizer_r(lowercase_						,	return_offsets_mapping=lowercase_						,	add_special_tokens=lowercase_							)
             self.assertEqual(encoding.offset_mapping[0]						,	(1, 1 + len(lowercase_							))							)
             self.assertEqual(
                 encoding.offset_mapping[1]						,	(1 + len(lowercase_							) + 1, 1 + len(lowercase_							) + 1 + len(lowercase_							))						,	)
 def 					UpperCAmelCase_							(    self				:Dict							)->							Optional[Any]:
     # Test related to the breaking change introduced in transformers v4.17.0
     # We need to check that an error in raised when the user try to load a previous version of the tokenizer.
     with self.assertRaises(lowercase_							) as context:
         self.rust_tokenizer_class.from_pretrained("robot-test/old-clip-tokenizer"							)

     self.assertTrue(
         context.exception.args[0].startswith(
             "The `backend_tokenizer` provided does not match the expected format."							)							)
 @require_ftfy
 def 					UpperCAmelCase_							(    self				:str							)->							Any:
     super().test_tokenization_python_rust_equals()



 def 					UpperCAmelCase_							(    self				:Optional[int]							)->							Union[str, Any]:
     # CLIP always lower cases letters
     pass



