
"""simple docstring"""


import unittest

from transformers import AlbertConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import 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,
          AlbertForMaskedLM,
          AlbertForMultipleChoice,
          AlbertForPreTraining,
          AlbertForQuestionAnswering,
          AlbertForSequenceClassification,
          AlbertForTokenClassification,
          AlbertModel,
      )
      from transformers.models.albert.modeling_albert import ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST



class   __a  :






       def __init__(  self :							Dict       ,      UpperCAmelCase_ :							List[str]       ,      UpperCAmelCase_ :							List[str]=13       ,      UpperCAmelCase_ :							Union[str, Any]=7       ,      UpperCAmelCase_ :							Optional[Any]=True       ,      UpperCAmelCase_ :							Union[str, Any]=True       ,      UpperCAmelCase_ :							Union[str, Any]=True       ,      UpperCAmelCase_ :							Union[str, Any]=True       ,      UpperCAmelCase_ :							Any=99       ,      UpperCAmelCase_ :							List[str]=16       ,      UpperCAmelCase_ :							int=36       ,      UpperCAmelCase_ :							List[Any]=6       ,      UpperCAmelCase_ :							List[str]=6       ,      UpperCAmelCase_ :							int=6       ,      UpperCAmelCase_ :							List[Any]=37       ,      UpperCAmelCase_ :							Optional[Any]="gelu"       ,      UpperCAmelCase_ :							Optional[Any]=0.1       ,      UpperCAmelCase_ :							Union[str, Any]=0.1       ,      UpperCAmelCase_ :							int=512       ,      UpperCAmelCase_ :							str=16       ,      UpperCAmelCase_ :							Dict=2       ,      UpperCAmelCase_ :							int=0.02       ,      UpperCAmelCase_ :							str=3       ,      UpperCAmelCase_ :							str=4       ,      UpperCAmelCase_ :							Any=None       ,      )->  Union[str, Any]:







              """simple docstring"""
              UpperCamelCase					 =		parent
              UpperCamelCase					 =		batch_size
              UpperCamelCase					 =		seq_length
              UpperCamelCase					 =		is_training
              UpperCamelCase					 =		use_input_mask
              UpperCamelCase					 =		use_token_type_ids
              UpperCamelCase					 =		use_labels
              UpperCamelCase					 =		vocab_size
              UpperCamelCase					 =		embedding_size
              UpperCamelCase					 =		hidden_size
              UpperCamelCase					 =		num_hidden_layers
              UpperCamelCase					 =		num_hidden_groups
              UpperCamelCase					 =		num_attention_heads
              UpperCamelCase					 =		intermediate_size
              UpperCamelCase					 =		hidden_act
              UpperCamelCase					 =		hidden_dropout_prob
              UpperCamelCase					 =		attention_probs_dropout_prob
              UpperCamelCase					 =		max_position_embeddings
              UpperCamelCase					 =		type_vocab_size
              UpperCamelCase					 =		type_sequence_label_size
              UpperCamelCase					 =		initializer_range
              UpperCamelCase					 =		num_labels
              UpperCamelCase					 =		num_choices
              UpperCamelCase					 =		scope






       def 	_SCREAMING_SNAKE_CASE       (  self :							List[str]			)->  Union[str, Any]:







              """simple docstring"""
              UpperCamelCase					 =		ids_tensor([self.batch_size, self.seq_length]       ,      self.vocab_size			)

              UpperCamelCase					 =		None
              if self.use_input_mask:
                     UpperCamelCase					 =		random_attention_mask([self.batch_size, self.seq_length]			)

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

              UpperCamelCase					 =		None
              UpperCamelCase					 =		None
              UpperCamelCase					 =		None
              if self.use_labels:
                     UpperCamelCase					 =		ids_tensor([self.batch_size]       ,      self.type_sequence_label_size			)
                     UpperCamelCase					 =		ids_tensor([self.batch_size, self.seq_length]       ,      self.num_labels			)
                     UpperCamelCase					 =		ids_tensor([self.batch_size]       ,      self.num_choices			)

              UpperCamelCase					 =		self.get_config()

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






       def 	_SCREAMING_SNAKE_CASE       (  self :							Dict			)->  int:







              """simple docstring"""
              return AlbertConfig(
                  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       ,      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       ,      initializer_range=self.initializer_range       ,      num_hidden_groups=self.num_hidden_groups       ,      )






       def 	_SCREAMING_SNAKE_CASE       (  self :							int       ,      UpperCAmelCase_ :							Optional[Any]       ,      UpperCAmelCase_ :							Tuple       ,      UpperCAmelCase_ :							Optional[Any]       ,      UpperCAmelCase_ :							Any       ,      UpperCAmelCase_ :							Optional[Any]       ,      UpperCAmelCase_ :							List[str]       ,      UpperCAmelCase_ :							List[Any]			)->  Optional[int]:







              """simple docstring"""
              UpperCamelCase					 =		AlbertModel(config=UpperCAmelCase_			)
              model.to(UpperCAmelCase_			)
              model.eval()
              UpperCamelCase					 =		model(UpperCAmelCase_       ,      attention_mask=UpperCAmelCase_       ,      token_type_ids=UpperCAmelCase_			)
              UpperCamelCase					 =		model(UpperCAmelCase_       ,      token_type_ids=UpperCAmelCase_			)
              UpperCamelCase					 =		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 	_SCREAMING_SNAKE_CASE       (  self :							Any       ,      UpperCAmelCase_ :							str       ,      UpperCAmelCase_ :							Tuple       ,      UpperCAmelCase_ :							Any       ,      UpperCAmelCase_ :							Tuple       ,      UpperCAmelCase_ :							Union[str, Any]       ,      UpperCAmelCase_ :							List[Any]       ,      UpperCAmelCase_ :							Tuple			)->  Optional[Any]:







              """simple docstring"""
              UpperCamelCase					 =		AlbertForPreTraining(config=UpperCAmelCase_			)
              model.to(UpperCAmelCase_			)
              model.eval()
              UpperCamelCase					 =		model(
                  UpperCAmelCase_       ,      attention_mask=UpperCAmelCase_       ,      token_type_ids=UpperCAmelCase_       ,      labels=UpperCAmelCase_       ,      sentence_order_label=UpperCAmelCase_       ,      )
              self.parent.assertEqual(result.prediction_logits.shape       ,      (self.batch_size, self.seq_length, self.vocab_size)			)
              self.parent.assertEqual(result.sop_logits.shape       ,      (self.batch_size, config.num_labels)			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Any       ,      UpperCAmelCase_ :							Any       ,      UpperCAmelCase_ :							List[Any]       ,      UpperCAmelCase_ :							Optional[int]       ,      UpperCAmelCase_ :							Union[str, Any]       ,      UpperCAmelCase_ :							Union[str, Any]       ,      UpperCAmelCase_ :							str       ,      UpperCAmelCase_ :							Any			)->  List[str]:







              """simple docstring"""
              UpperCamelCase					 =		AlbertForMaskedLM(config=UpperCAmelCase_			)
              model.to(UpperCAmelCase_			)
              model.eval()
              UpperCamelCase					 =		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 	_SCREAMING_SNAKE_CASE       (  self :							List[Any]       ,      UpperCAmelCase_ :							str       ,      UpperCAmelCase_ :							Tuple       ,      UpperCAmelCase_ :							Any       ,      UpperCAmelCase_ :							Optional[int]       ,      UpperCAmelCase_ :							Any       ,      UpperCAmelCase_ :							Optional[int]       ,      UpperCAmelCase_ :							Any			)->  str:







              """simple docstring"""
              UpperCamelCase					 =		AlbertForQuestionAnswering(config=UpperCAmelCase_			)
              model.to(UpperCAmelCase_			)
              model.eval()
              UpperCamelCase					 =		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 	_SCREAMING_SNAKE_CASE       (  self :							Union[str, Any]       ,      UpperCAmelCase_ :							Any       ,      UpperCAmelCase_ :							List[Any]       ,      UpperCAmelCase_ :							Union[str, Any]       ,      UpperCAmelCase_ :							Dict       ,      UpperCAmelCase_ :							Union[str, Any]       ,      UpperCAmelCase_ :							List[Any]       ,      UpperCAmelCase_ :							Any			)->  Dict:







              """simple docstring"""
              UpperCamelCase					 =		self.num_labels
              UpperCamelCase					 =		AlbertForSequenceClassification(UpperCAmelCase_			)
              model.to(UpperCAmelCase_			)
              model.eval()
              UpperCamelCase					 =		model(UpperCAmelCase_       ,      attention_mask=UpperCAmelCase_       ,      token_type_ids=UpperCAmelCase_       ,      labels=UpperCAmelCase_			)
              self.parent.assertEqual(result.logits.shape       ,      (self.batch_size, self.num_labels)			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[Any]       ,      UpperCAmelCase_ :							Dict       ,      UpperCAmelCase_ :							Tuple       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							Dict       ,      UpperCAmelCase_ :							Union[str, Any]       ,      UpperCAmelCase_ :							Dict       ,      UpperCAmelCase_ :							str			)->  Union[str, Any]:







              """simple docstring"""
              UpperCamelCase					 =		self.num_labels
              UpperCamelCase					 =		AlbertForTokenClassification(config=UpperCAmelCase_			)
              model.to(UpperCAmelCase_			)
              model.eval()
              UpperCamelCase					 =		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 	_SCREAMING_SNAKE_CASE       (  self :							Tuple       ,      UpperCAmelCase_ :							Any       ,      UpperCAmelCase_ :							Dict       ,      UpperCAmelCase_ :							Any       ,      UpperCAmelCase_ :							Union[str, Any]       ,      UpperCAmelCase_ :							Optional[Any]       ,      UpperCAmelCase_ :							Union[str, Any]       ,      UpperCAmelCase_ :							Optional[Any]			)->  Union[str, Any]:







              """simple docstring"""
              UpperCamelCase					 =		self.num_choices
              UpperCamelCase					 =		AlbertForMultipleChoice(config=UpperCAmelCase_			)
              model.to(UpperCAmelCase_			)
              model.eval()
              UpperCamelCase					 =		input_ids.unsqueeze(1			).expand(-1       ,      self.num_choices       ,      -1			).contiguous()
              UpperCamelCase					 =		token_type_ids.unsqueeze(1			).expand(-1       ,      self.num_choices       ,      -1			).contiguous()
              UpperCamelCase					 =		input_mask.unsqueeze(1			).expand(-1       ,      self.num_choices       ,      -1			).contiguous()
              UpperCamelCase					 =		model(
                  UpperCAmelCase_       ,      attention_mask=UpperCAmelCase_       ,      token_type_ids=UpperCAmelCase_       ,      labels=UpperCAmelCase_       ,      )
              self.parent.assertEqual(result.logits.shape       ,      (self.batch_size, self.num_choices)			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Union[str, Any]			)->  Optional[int]:







              """simple docstring"""
              UpperCamelCase					 =		self.prepare_config_and_inputs()
              (
                  (
                  UpperCamelCase
              ) ,       (
                  UpperCamelCase
              ) ,       (
                  UpperCamelCase
              ) ,       (
                  UpperCamelCase
              ) ,       (
                  UpperCamelCase
              ) ,       (
                  UpperCamelCase
              ) ,       (
                  UpperCamelCase
              ) ,       
              )					 =		config_and_inputs
              UpperCamelCase					 =		{"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
              return config, inputs_dict





@require_torch
class   __a  (      _lowerCAmelCase    ,     _lowerCAmelCase    ,     unittest.TestCase	):
       UpperCamelCase_		:					Tuple   =			(
           (
               AlbertModel,
               AlbertForPreTraining,
               AlbertForMaskedLM,
               AlbertForMultipleChoice,
               AlbertForSequenceClassification,
               AlbertForTokenClassification,
               AlbertForQuestionAnswering,
           )
           if is_torch_available()
           else ()
       )
       UpperCamelCase_		:					Optional[int]   =			(
           {
               '''feature-extraction''': AlbertModel,
               '''fill-mask''': AlbertForMaskedLM,
               '''question-answering''': AlbertForQuestionAnswering,
               '''text-classification''': AlbertForSequenceClassification,
               '''token-classification''': AlbertForTokenClassification,
               '''zero-shot''': AlbertForSequenceClassification,
           }
           if is_torch_available()
           else {}
       )
       UpperCamelCase_		:					Union[str, Any]   =			True






       def 	_SCREAMING_SNAKE_CASE       (  self :							List[Any]       ,      UpperCAmelCase_ :							str       ,      UpperCAmelCase_ :							Tuple       ,      UpperCAmelCase_ :							Tuple=False			)->  int:







              """simple docstring"""
              UpperCamelCase					 =		super()._prepare_for_class(UpperCAmelCase_       ,      UpperCAmelCase_       ,      return_labels=UpperCAmelCase_			)

              if return_labels:
                     if model_class in get_values(UpperCAmelCase_			):
                            UpperCamelCase					 =		torch.zeros(
                                (self.model_tester.batch_size, self.model_tester.seq_length)       ,      dtype=torch.long       ,      device=UpperCAmelCase_			)
                            UpperCamelCase					 =		torch.zeros(
                                self.model_tester.batch_size       ,      dtype=torch.long       ,      device=UpperCAmelCase_			)
              return inputs_dict






       def 	_SCREAMING_SNAKE_CASE       (  self :							int			)->  Union[str, Any]:







              """simple docstring"""
              UpperCamelCase					 =		AlbertModelTester(self			)
              UpperCamelCase					 =		ConfigTester(self       ,      config_class=UpperCAmelCase_       ,      hidden_size=37			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[int]			)->  List[Any]:







              """simple docstring"""
              self.config_tester.run_common_tests()






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[int]			)->  Dict:







              """simple docstring"""
              UpperCamelCase					 =		self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_model(*UpperCAmelCase_			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							str			)->  List[str]:







              """simple docstring"""
              UpperCamelCase					 =		self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_for_pretraining(*UpperCAmelCase_			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							List[str]			)->  str:







              """simple docstring"""
              UpperCamelCase					 =		self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_for_masked_lm(*UpperCAmelCase_			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Any			)->  int:







              """simple docstring"""
              UpperCamelCase					 =		self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_for_multiple_choice(*UpperCAmelCase_			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							int			)->  str:







              """simple docstring"""
              UpperCamelCase					 =		self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_for_question_answering(*UpperCAmelCase_			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							int			)->  Optional[Any]:







              """simple docstring"""
              UpperCamelCase					 =		self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_for_sequence_classification(*UpperCAmelCase_			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Dict			)->  List[Any]:







              """simple docstring"""
              UpperCamelCase					 =		self.model_tester.prepare_config_and_inputs()
              for type in ["absolute", "relative_key", "relative_key_query"]:
                     UpperCamelCase					 =		type
                     self.model_tester.create_and_check_model(*UpperCAmelCase_			)






       @slow
       def 	_SCREAMING_SNAKE_CASE       (  self :							List[Any]			)->  Optional[Any]:







              """simple docstring"""
              for model_name in ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                     UpperCamelCase					 =		AlbertModel.from_pretrained(UpperCAmelCase_			)
                     self.assertIsNotNone(UpperCAmelCase_			)





@require_torch
class   __a  (      unittest.TestCase	):






       @slow
       def 	_SCREAMING_SNAKE_CASE       (  self :							Tuple			)->  Optional[int]:







              """simple docstring"""
              UpperCamelCase					 =		AlbertModel.from_pretrained("albert-base-v2"			)
              UpperCamelCase					 =		torch.tensor([[0, 345, 232, 328, 740, 140, 1_695, 69, 6_078, 1_588, 2]]			)
              UpperCamelCase					 =		torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]			)
              with torch.no_grad():
                     UpperCamelCase					 =		model(UpperCAmelCase_       ,      attention_mask=UpperCAmelCase_			)[0]
              UpperCamelCase					 =		torch.Size((1, 11, 768)			)
              self.assertEqual(output.shape       ,      UpperCAmelCase_			)
              UpperCamelCase					 =		torch.tensor(
                  [[[-0.6513, 1.5035, -0.2766], [-0.6515, 1.5046, -0.2780], [-0.6512, 1.5049, -0.2784]]]			)

              self.assertTrue(torch.allclose(output[:, 1:4, 1:4]       ,      UpperCAmelCase_       ,      atol=1e-4			)			)







"""simple docstring"""


import unittest

from transformers import BarthezTokenizer, BarthezTokenizerFast, BatchEncoding
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow

from ...test_tokenization_common import TokenizerTesterMixin



@require_tokenizers
@require_sentencepiece
@slow  # see https://github.com/huggingface/transformers/issues/11457
class   __a  (      _lowerCAmelCase    ,     unittest.TestCase	):
       UpperCamelCase_		:					Any   =			BarthezTokenizer
       UpperCamelCase_		:					Tuple   =			BarthezTokenizerFast
       UpperCamelCase_		:					str   =			True
       UpperCamelCase_		:					Dict   =			True






       def 	_SCREAMING_SNAKE_CASE       (  self :							List[Any]			)->  int:







              """simple docstring"""
              super().setUp()

              UpperCamelCase					 =		BarthezTokenizerFast.from_pretrained("moussaKam/mbarthez"			)
              tokenizer.save_pretrained(self.tmpdirname			)
              tokenizer.save_pretrained(self.tmpdirname       ,      legacy_format=UpperCAmelCase_			)
              UpperCamelCase					 =		tokenizer






       def 	_SCREAMING_SNAKE_CASE       (  self :							Dict			)->  Optional[Any]:







              """simple docstring"""
              UpperCamelCase					 =		"<pad>"
              UpperCamelCase					 =		1

              self.assertEqual(self.get_tokenizer()._convert_token_to_id(UpperCAmelCase_			)       ,      UpperCAmelCase_			)
              self.assertEqual(self.get_tokenizer()._convert_id_to_token(UpperCAmelCase_			)       ,      UpperCAmelCase_			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[int]			)->  int:







              """simple docstring"""
              UpperCamelCase					 =		list(self.get_tokenizer().get_vocab().keys()			)

              self.assertEqual(vocab_keys[0]       ,      "<s>"			)
              self.assertEqual(vocab_keys[1]       ,      "<pad>"			)
              self.assertEqual(vocab_keys[-1]       ,      "<mask>"			)
              self.assertEqual(len(UpperCAmelCase_			)       ,      101_122			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							List[Any]			)->  List[str]:







              """simple docstring"""
              self.assertEqual(self.get_tokenizer().vocab_size       ,      101_122			)






       @require_torch
       def 	_SCREAMING_SNAKE_CASE       (  self :							Union[str, Any]			)->  int:







              """simple docstring"""
              UpperCamelCase					 =		["A long paragraph for summarization.", "Another paragraph for summarization."]
              UpperCamelCase					 =		[0, 57, 3_018, 70_307, 91, 2]

              UpperCamelCase					 =		self.tokenizer(
                  UpperCAmelCase_       ,      max_length=len(UpperCAmelCase_			)       ,      padding=UpperCAmelCase_       ,      truncation=UpperCAmelCase_       ,      return_tensors="pt"			)
              self.assertIsInstance(UpperCAmelCase_       ,      UpperCAmelCase_			)

              self.assertEqual((2, 6)       ,      batch.input_ids.shape			)
              self.assertEqual((2, 6)       ,      batch.attention_mask.shape			)
              UpperCamelCase					 =		batch.input_ids.tolist()[0]
              self.assertListEqual(UpperCAmelCase_       ,      UpperCAmelCase_			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[int]			)->  Optional[int]:







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

              UpperCamelCase					 =		self.get_tokenizer()
              UpperCamelCase					 =		self.get_rust_tokenizer()

              UpperCamelCase					 =		"I was born in 92000, and this is falsé."

              UpperCamelCase					 =		tokenizer.tokenize(UpperCAmelCase_			)
              UpperCamelCase					 =		rust_tokenizer.tokenize(UpperCAmelCase_			)
              self.assertListEqual(UpperCAmelCase_       ,      UpperCAmelCase_			)

              UpperCamelCase					 =		tokenizer.encode(UpperCAmelCase_       ,      add_special_tokens=UpperCAmelCase_			)
              UpperCamelCase					 =		rust_tokenizer.encode(UpperCAmelCase_       ,      add_special_tokens=UpperCAmelCase_			)
              self.assertListEqual(UpperCAmelCase_       ,      UpperCAmelCase_			)

              UpperCamelCase					 =		self.get_rust_tokenizer()
              UpperCamelCase					 =		tokenizer.encode(UpperCAmelCase_			)
              UpperCamelCase					 =		rust_tokenizer.encode(UpperCAmelCase_			)
              self.assertListEqual(UpperCAmelCase_       ,      UpperCAmelCase_			)






       @slow
       def 	_SCREAMING_SNAKE_CASE       (  self :							int			)->  Union[str, Any]:







              """simple docstring"""
              # fmt: off
              UpperCamelCase					 =		{"input_ids": [[0, 490, 14_328, 4_507, 354, 47, 43_669, 95, 25, 78_117, 20_215, 19_779, 190, 22, 400, 4, 35_343, 80_310, 603, 86, 24_937, 105, 33_438, 94_762, 196, 39_642, 7, 15, 15_933, 173, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 10_534, 87, 25, 66, 3_358, 196, 55_289, 8, 82_961, 81, 2_204, 75_203, 7, 15, 763, 12_956, 216, 178, 14_328, 9_595, 1_377, 69_693, 7, 448, 71_021, 196, 18_106, 1_437, 13_974, 108, 9_083, 4, 49_315, 7, 39, 86, 1_326, 2_793, 46_333, 4, 448, 196, 74_588, 7, 49_315, 7, 39, 21, 822, 38_470, 74, 21, 66_723, 62_480, 8, 22_050, 5, 2]], "attention_mask": [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]}  # noqa: E501
              # fmt: on

              # moussaKam/mbarthez is a french model. So we also use french texts.
              UpperCamelCase					 =		[
                  "Le transformeur est un modèle d'apprentissage profond introduit en 2017, "
                  "utilisé principalement dans le domaine du traitement automatique des langues (TAL).",
                  "À l'instar des réseaux de neurones récurrents (RNN), les transformeurs sont conçus "
                  "pour gérer des données séquentielles, telles que le langage naturel, pour des tâches "
                  "telles que la traduction et la synthèse de texte.",
              ]

              self.tokenizer_integration_test_util(
                  expected_encoding=UpperCAmelCase_       ,      model_name="moussaKam/mbarthez"       ,      revision="c2e4ecbca5e3cd2c37fe1ac285ca4fbdf1366fb6"       ,      sequences=UpperCAmelCase_       ,      )





