




import math
import os
import unittest

from transformers import MegatronBertConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
  import torch

  from transformers import (
      MODEL_FOR_PRETRAINING_MAPPING,
      MegatronBertForCausalLM,
      MegatronBertForMaskedLM,
      MegatronBertForMultipleChoice,
      MegatronBertForNextSentencePrediction,
      MegatronBertForPreTraining,
      MegatronBertForQuestionAnswering,
      MegatronBertForSequenceClassification,
      MegatronBertForTokenClassification,
      MegatronBertModel,
  )







class 		lowercase							:

     def __init__(						self	,  _a	,  _a=13	,  _a=7	,  _a=True	,  _a=True	,  _a=True	,  _a=True	,  _a=99	,  _a=64	,  _a=32	,  _a=5	,  _a=4	,  _a=37	,  _a="gelu"	,  _a=0.1	,  _a=0.1	,  _a=512	,  _a=16	,  _a=2	,  _a=0.02	,  _a=3	,  _a=4	,  _a=None	,  )		->							Optional[int]:
           _A							:  List[Any]    =		parent
           _A							:  str    =		batch_size
           _A							:  Optional[int]    =		seq_length
           _A							:  str    =		is_training
           _A							:  Tuple    =		use_input_mask
           _A							:  Dict    =		use_token_type_ids
           _A							:  Union[str, Any]    =		use_labels
           _A							:  List[str]    =		vocab_size
           _A							:  Any    =		hidden_size
           _A							:  int    =		embedding_size
           _A							:  Union[str, Any]    =		num_hidden_layers
           _A							:  Optional[int]    =		num_attention_heads
           _A							:  Any    =		intermediate_size
           _A							:  Dict    =		hidden_act
           _A							:  List[str]    =		hidden_dropout_prob
           _A							:  Tuple    =		attention_probs_dropout_prob
           _A							:  str    =		max_position_embeddings
           _A							:  Optional[Any]    =		type_vocab_size
           _A							:  str    =		type_sequence_label_size
           _A							:  str    =		initializer_range
           _A							:  int    =		num_labels
           _A							:  Optional[int]    =		num_choices
           _A							:  Dict    =		scope

     def       a__			(						self       )		->							int:
           _A							:  Optional[int]    =		ids_tensor([self.batch_size, self.seq_length]	,  self.vocab_size       )

           _A							:  Dict    =		None
           if self.use_input_mask:
                 _A							:  Tuple    =		random_attention_mask([self.batch_size, self.seq_length]       )

           _A							:  List[Any]    =		None
           if self.use_token_type_ids:
                 _A							:  Any    =		ids_tensor([self.batch_size, self.seq_length]	,  self.type_vocab_size       )

           _A							:  Dict    =		None
           _A							:  Tuple    =		None
           _A							:  List[str]    =		None
           if self.use_labels:
                 _A							:  List[Any]    =		ids_tensor([self.batch_size]	,  self.type_sequence_label_size       )
                 _A							:  List[str]    =		ids_tensor([self.batch_size, self.seq_length]	,  self.num_labels       )
                 _A							:  Optional[Any]    =		ids_tensor([self.batch_size]	,  self.num_choices       )

           _A							:  Optional[Any]    =		self.get_config()

           return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels

     def       a__			(						self       )		->							Union[str, Any]:
           return MegatronBertConfig(
               vocab_size=self.vocab_size	,  hidden_size=self.hidden_size	,  num_hidden_layers=self.num_hidden_layers	,  num_attention_heads=self.num_attention_heads	,  intermediate_size=self.intermediate_size	,  embedding_size=self.embedding_size	,  hidden_act=self.hidden_act	,  hidden_dropout_prob=self.hidden_dropout_prob	,  attention_probs_dropout_prob=self.attention_probs_dropout_prob	,  max_position_embeddings=self.max_position_embeddings	,  type_vocab_size=self.type_vocab_size	,  is_decoder=__UpperCamelCase	,  initializer_range=self.initializer_range	,  )

     def       a__			(						self	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a       )		->							str:
           _A							:  List[str]    =		MegatronBertModel(config=__UpperCamelCase       )
           model.to(__UpperCamelCase       )
           model.eval()
           _A							:  int    =		model(__UpperCamelCase	,  attention_mask=__UpperCamelCase	,  token_type_ids=__UpperCamelCase       )
           _A							:  Optional[Any]    =		model(__UpperCamelCase	,  token_type_ids=__UpperCamelCase       )
           _A							:  Tuple    =		model(__UpperCamelCase       )

           self.parent.assertEqual(result.last_hidden_state.shape	,  (self.batch_size, self.seq_length, self.hidden_size)       )
           self.parent.assertEqual(result.pooler_output.shape	,  (self.batch_size, self.hidden_size)       )

     def       a__			(						self	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a       )		->							Any:
           _A							:  int    =		MegatronBertForMaskedLM(config=__UpperCamelCase       )
           model.to(__UpperCamelCase       )
           model.eval()
           _A							:  Any    =		model(__UpperCamelCase	,  attention_mask=__UpperCamelCase	,  token_type_ids=__UpperCamelCase	,  labels=__UpperCamelCase       )
           self.parent.assertEqual(result.logits.shape	,  (self.batch_size, self.seq_length, self.vocab_size)       )

     def       a__			(						self	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a       )		->							Any:
           _A							:  Optional[int]    =		MegatronBertForCausalLM(config=__UpperCamelCase       )
           model.to(__UpperCamelCase       )
           model.eval()
           _A							:  Optional[Any]    =		model(__UpperCamelCase	,  attention_mask=__UpperCamelCase	,  token_type_ids=__UpperCamelCase	,  labels=__UpperCamelCase       )
           self.parent.assertEqual(result.logits.shape	,  (self.batch_size, self.seq_length, self.vocab_size)       )

     def       a__			(						self	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a       )		->							int:
           _A							:  int    =		MegatronBertForNextSentencePrediction(config=__UpperCamelCase       )
           model.to(__UpperCamelCase       )
           model.eval()
           _A							:  Optional[Any]    =		model(
               __UpperCamelCase	,  attention_mask=__UpperCamelCase	,  token_type_ids=__UpperCamelCase	,  labels=__UpperCamelCase	,  )
           self.parent.assertEqual(result.logits.shape	,  (self.batch_size, 2)       )

     def       a__			(						self	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a       )		->							List[Any]:
           _A							:  Dict    =		MegatronBertForPreTraining(config=__UpperCamelCase       )
           model.to(__UpperCamelCase       )
           model.eval()
           _A							:  Dict    =		model(
               __UpperCamelCase	,  attention_mask=__UpperCamelCase	,  token_type_ids=__UpperCamelCase	,  labels=__UpperCamelCase	,  next_sentence_label=__UpperCamelCase	,  )
           self.parent.assertEqual(result.prediction_logits.shape	,  (self.batch_size, self.seq_length, self.vocab_size)       )
           self.parent.assertEqual(result.seq_relationship_logits.shape	,  (self.batch_size, 2)       )

     def       a__			(						self	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a       )		->							List[str]:
           _A							:  List[str]    =		MegatronBertForQuestionAnswering(config=__UpperCamelCase       )
           model.to(__UpperCamelCase       )
           model.eval()
           _A							:  List[str]    =		model(
               __UpperCamelCase	,  attention_mask=__UpperCamelCase	,  token_type_ids=__UpperCamelCase	,  start_positions=__UpperCamelCase	,  end_positions=__UpperCamelCase	,  )
           self.parent.assertEqual(result.start_logits.shape	,  (self.batch_size, self.seq_length)       )
           self.parent.assertEqual(result.end_logits.shape	,  (self.batch_size, self.seq_length)       )

     def       a__			(						self	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a       )		->							int:
           _A							:  Union[str, Any]    =		self.num_labels
           _A							:  int    =		MegatronBertForSequenceClassification(__UpperCamelCase       )
           model.to(__UpperCamelCase       )
           model.eval()
           _A							:  Dict    =		model(__UpperCamelCase	,  attention_mask=__UpperCamelCase	,  token_type_ids=__UpperCamelCase	,  labels=__UpperCamelCase       )
           self.parent.assertEqual(result.logits.shape	,  (self.batch_size, self.num_labels)       )

     def       a__			(						self	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a       )		->							List[str]:
           _A							:  Union[str, Any]    =		self.num_labels
           _A							:  Any    =		MegatronBertForTokenClassification(config=__UpperCamelCase       )
           model.to(__UpperCamelCase       )
           model.eval()
           _A							:  Any    =		model(__UpperCamelCase	,  attention_mask=__UpperCamelCase	,  token_type_ids=__UpperCamelCase	,  labels=__UpperCamelCase       )
           self.parent.assertEqual(result.logits.shape	,  (self.batch_size, self.seq_length, self.num_labels)       )

     def       a__			(						self	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a       )		->							Union[str, Any]:
           _A							:  int    =		self.num_choices
           _A							:  Optional[Any]    =		MegatronBertForMultipleChoice(config=__UpperCamelCase       )
           model.to(__UpperCamelCase       )
           model.eval()
           _A							:  int    =		input_ids.unsqueeze(1       ).expand(-1	,  self.num_choices	,  -1       ).contiguous()
           _A							:  Union[str, Any]    =		token_type_ids.unsqueeze(1       ).expand(-1	,  self.num_choices	,  -1       ).contiguous()
           _A							:  int    =		input_mask.unsqueeze(1       ).expand(-1	,  self.num_choices	,  -1       ).contiguous()
           _A							:  Union[str, Any]    =		model(
               __UpperCamelCase	,  attention_mask=__UpperCamelCase	,  token_type_ids=__UpperCamelCase	,  labels=__UpperCamelCase	,  )
           self.parent.assertEqual(result.logits.shape	,  (self.batch_size, self.num_choices)       )



     def       a__			(						self       )		->							Optional[Any]:
           _A							:  int    =		self.prepare_config_and_inputs()
           (
               (
               _A       
           )    ,     (
               _A       
           )    ,     (
               _A       
           )    ,     (
               _A       
           )    ,     (
               _A       
           )    ,     (
               _A       
           )    ,     (
               _A       
           )    ,            
           )							:  Any    =		config_and_inputs
           _A							:  List[Any]    =		{"""input_ids""": input_ids, """token_type_ids""": token_type_ids, """attention_mask""": input_mask}
           return config, inputs_dict







@require_torch
class 		lowercase							(     __snake_case,__snake_case,unittest.TestCase	):
     _a											=		(
         (
             MegatronBertModel,
             MegatronBertForMaskedLM,
             MegatronBertForCausalLM,
             MegatronBertForMultipleChoice,
             MegatronBertForNextSentencePrediction,
             MegatronBertForPreTraining,
             MegatronBertForQuestionAnswering,
             MegatronBertForSequenceClassification,
             MegatronBertForTokenClassification,
         )
         if is_torch_available()
         else ()
     )
     _a											=		(
         {
             "feature-extraction": MegatronBertModel,
             "fill-mask": MegatronBertForMaskedLM,
             "question-answering": MegatronBertForQuestionAnswering,
             "text-classification": MegatronBertForSequenceClassification,
             "text-generation": MegatronBertForCausalLM,
             "token-classification": MegatronBertForTokenClassification,
             "zero-shot": MegatronBertForSequenceClassification,
         }
         if is_torch_available()
         else {}
     )
     _a											=		True
     # test_resize_embeddings = False
     _a											=		False

     def       a__			(						self	,  _a	,  _a	,  _a=False       )		->							str:
           _A							:  List[Any]    =		super()._prepare_for_class(__UpperCamelCase	,  __UpperCamelCase	,  return_labels=__UpperCamelCase       )

           if return_labels:
                 if model_class in get_values(__UpperCamelCase       ):
                       _A							:  Dict    =		torch.zeros(
                           (self.model_tester.batch_size, self.model_tester.seq_length)	,  dtype=torch.long	,  device=__UpperCamelCase       )
                       _A							:  List[str]    =		torch.zeros(
                           self.model_tester.batch_size	,  dtype=torch.long	,  device=__UpperCamelCase       )
           return inputs_dict

     def       a__			(						self       )		->							Tuple:
           _A							:  Any    =		MegatronBertModelTester(self       )
           _A							:  Any    =		ConfigTester(self	,  config_class=__UpperCamelCase	,  hidden_size=37       )

     def       a__			(						self       )		->							str:
           self.config_tester.run_common_tests()

     def       a__			(						self       )		->							Tuple:
           _A							:  List[str]    =		self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_megatron_bert_model(*__UpperCamelCase       )

     def       a__			(						self       )		->							int:
           _A							:  Any    =		self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_megatron_bert_for_masked_lm(*__UpperCamelCase       )

     def       a__			(						self       )		->							int:
           _A							:  List[Any]    =		self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_megatron_bert_for_multiple_choice(*__UpperCamelCase       )

     def       a__			(						self       )		->							str:
           _A							:  Any    =		self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_megatron_bert_for_next_sequence_prediction(*__UpperCamelCase       )

     def       a__			(						self       )		->							int:
           _A							:  Tuple    =		self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_megatron_bert_for_pretraining(*__UpperCamelCase       )

     def       a__			(						self       )		->							int:
           _A							:  Optional[int]    =		self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_megatron_bert_for_question_answering(*__UpperCamelCase       )

     def       a__			(						self       )		->							Tuple:
           _A							:  Optional[int]    =		self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_megatron_bert_for_sequence_classification(*__UpperCamelCase       )



     def       a__			(						self       )		->							int:
           _A							:  Dict    =		self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_megatron_bert_for_token_classification(*__UpperCamelCase       )







def        lowerCAmelCase_			(  snake_case_  ):
      return torch.tensor(
          lowercase__,dtype=torch.long,device=lowercase__,)


_snake_case            = 1e-4







@require_torch
@require_sentencepiece
@require_tokenizers
class 		lowercase							(     unittest.TestCase	):

     @slow
     @unittest.skip("""Model is not available."""       )
     def       a__			(						self       )		->							int:
           _A							:  List[Any]    =		"""nvidia/megatron-bert-uncased-345m"""
           if "MYDIR" in os.environ:
                 _A							:  List[Any]    =		os.path.join(os.environ["""MYDIR"""]	,  __UpperCamelCase       )
           _A							:  Union[str, Any]    =		MegatronBertModel.from_pretrained(__UpperCamelCase       )
           model.to(__UpperCamelCase       )
           model.half()
           _A							:  str    =		_long_tensor([[101, 7110, 1005, 1056, 2023, 1_1333, 1_7413, 1029, 102]]       )
           with torch.no_grad():
                 _A							:  Optional[int]    =		model(__UpperCamelCase       )[0]
           _A							:  List[str]    =		torch.Size((1, 9, 1024)       )
           self.assertEqual(output.shape	,  __UpperCamelCase       )

           _A							:  Any    =		[-0.6040, -0.2517, -0.1025, 0.3420, -0.6758, -0.0017, -0.1089, -0.1990, 0.5728]
           for ii in range(3       ):
                 for jj in range(3       ):
                       _A							:  int    =		output[0, ii, jj]
                       _A							:  Any    =		expected[3 * ii + jj]
                       _A							:  List[str]    =		"""ii={} jj={} a={} b={}""".format(__UpperCamelCase	,  __UpperCamelCase	,  __UpperCamelCase	,  __UpperCamelCase       )
                       self.assertTrue(math.isclose(__UpperCamelCase	,  __UpperCamelCase	,  rel_tol=__UpperCamelCase	,  abs_tol=__UpperCamelCase       )	,  msg=__UpperCamelCase       )







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 		lowercase							(     UpperCamelCase__,unittest.TestCase	):
     _a											=		CLIPTokenizer
     _a											=		CLIPTokenizerFast
     _a											=		True
     _a											=		{}
     _a											=		False

     def       a__			(						self       )		->							Optional[Any]:
           super().setUp()

           # fmt: off
           _A							:  int    =		["""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							:  str    =		dict(zip(_a	,  range(len(_a       )       )       )       )
           _A							:  Optional[int]    =		["""#version: 0.2""", """l o""", """lo w</w>""", """e r</w>"""]
           _A							:  str    =		{"""unk_token""": """<unk>"""}

           _A							:  Union[str, Any]    =		os.path.join(self.tmpdirname	,  VOCAB_FILES_NAMES["""vocab_file"""]       )
           _A							:  Union[str, Any]    =		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(_a       ) + """\n"""       )
           with open(self.merges_file	,  """w"""	,  encoding="""utf-8"""       ) as fp:
                 fp.write("""\n""".join(_a       )       )

     def       a__			(						self	,  **_a       )		->							List[Any]:
           kwargs.update(self.special_tokens_map       )
           return CLIPTokenizer.from_pretrained(self.tmpdirname	,  **_a       )

     def       a__			(						self	,  **_a       )		->							Union[str, Any]:
           kwargs.update(self.special_tokens_map       )
           return CLIPTokenizerFast.from_pretrained(self.tmpdirname	,  **_a       )

     def       a__			(						self	,  _a       )		->							str:
           _A							:  Tuple    =		"""lower newer"""
           _A							:  Optional[Any]    =		"""lower newer"""
           return input_text, output_text

     def       a__			(						self       )		->							List[Any]:
           _A							:  Optional[int]    =		CLIPTokenizer(self.vocab_file	,  self.merges_file	,  **self.special_tokens_map       )
           _A							:  str    =		"""lower newer"""
           _A							:  List[str]    =		["""lo""", """w""", """er</w>""", """n""", """e""", """w""", """er</w>"""]
           _A							:  int    =		tokenizer.tokenize(_a       )
           self.assertListEqual(_a	,  _a       )

           _A							:  str    =		tokens + [tokenizer.unk_token]
           _A							:  Dict    =		[10, 2, 16, 9, 3, 2, 16, 20]
           self.assertListEqual(tokenizer.convert_tokens_to_ids(_a       )	,  _a       )

     @require_ftfy
     def       a__			(						self       )		->							Tuple:
           for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
                 with self.subTest(F'''{tokenizer.__class__.__name__} ({pretrained_name})'''       ):
                       _A							:  Dict    =		self.tokenizer_class.from_pretrained(_a	,  **_a       )
                       _A							:  str    =		self.rust_tokenizer_class.from_pretrained(_a	,  **_a       )

                       _A							:  List[str]    =		"""A\n'll 11p223RF☆ho!!to?'d'd''d of a cat to-$''d."""
                       _A							:  Dict    =		tokenizer_s.tokenize(_a       )
                       _A							:  Dict    =		tokenizer_r.tokenize(_a       )

                       self.assertListEqual(_a	,  _a       )

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

                       self.assertListEqual(_a	,  _a       )

                       # Test that the tokenization is identical on unicode of space type
                       _A							:  Any    =		[
                           """\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							:  Optional[int]    =		tokenizer_s.tokenize(_a       )
                             _A							:  List[Any]    =		tokenizer_r.tokenize(_a       )

                             self.assertListEqual(_a	,  _a       )

                       # Test that the tokenization is identical on unicode of line break type
                       _A							:  int    =		[
                           """\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							:  Optional[Any]    =		tokenizer_s.tokenize(_a       )
                             _A							:  Tuple    =		tokenizer_r.tokenize(_a       )

                             self.assertListEqual(_a	,  _a       )

     def       a__			(						self       )		->							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							:  List[Any]    =		"""hello"""  # `hello` is a token in the vocabulary of `pretrained_name`
                       _A							:  str    =		F'''{text_of_1_token} {text_of_1_token}'''

                       _A							:  str    =		self.rust_tokenizer_class.from_pretrained(
                           _a	,  use_fast=_a	,  )
                       _A							:  Dict    =		tokenizer_r(_a	,  return_offsets_mapping=_a	,  add_special_tokens=_a       )
                       self.assertEqual(encoding.offset_mapping[0]	,  (0, len(_a       ))       )
                       self.assertEqual(
                           encoding.offset_mapping[1]	,  (len(_a       ) + 1, len(_a       ) + 1 + len(_a       ))	,  )

                       _A							:  Any    =		F''' {text}'''

                       _A							:  List[Any]    =		self.rust_tokenizer_class.from_pretrained(
                           _a	,  use_fast=_a	,  )
                       _A							:  Optional[int]    =		tokenizer_r(_a	,  return_offsets_mapping=_a	,  add_special_tokens=_a       )
                       self.assertEqual(encoding.offset_mapping[0]	,  (1, 1 + len(_a       ))       )
                       self.assertEqual(
                           encoding.offset_mapping[1]	,  (1 + len(_a       ) + 1, 1 + len(_a       ) + 1 + len(_a       ))	,  )

     def       a__			(						self       )		->							List[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(_a       ) 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       a__			(						self       )		->							str:
           super().test_tokenization_python_rust_equals()



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

