






import inspect
import unittest
from typing import List

import numpy as np

from transformers import EfficientFormerConfig
from transformers.testing_utils import require_tf, require_vision, slow
from transformers.utils import cached_property, is_tf_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
	import tensorflow as tf

	from transformers import (
	    TFEfficientFormerForImageClassification,
	    TFEfficientFormerForImageClassificationWithTeacher,
	    TFEfficientFormerModel,
	)
	from transformers.models.efficientformer.modeling_tf_efficientformer import (
	    TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
	)


if is_vision_available():
	from PIL import Image

	from transformers import EfficientFormerImageProcessor

class 						lowerCAmelCase   :

					'''simple docstring'''

					def __init__(     self :		str						,   __a :		List[str]						,   __a :		int = 13						,   __a :		int = 64						,   __a :		int = 2						,   __a :		int = 3						,   __a :		int = 3						,   __a :		bool = True						,   __a :		bool = True						,   __a :		int = 128						,   __a :		Optional[Any]=[16, 32, 64, 128]						,   __a :		int = 7						,   __a :		int = 4						,   __a :		int = 37						,   __a :		str = "gelu"						,   __a :		float = 0.1						,   __a :		float = 0.1						,   __a :		int = 10						,   __a :		float = 0.02						,   __a :		int = 2						,   __a :		int = 1						,   __a :		int = 128						,   __a :		List[int] = [2, 2, 2, 2]						,   __a :		int = 2						,   __a :		int = 2						,   )	->     Optional[Any]:


												"""simple docstring"""

												__lowercase					:							Optional[int]			=   parent
												__lowercase					:							Tuple			=   batch_size
												__lowercase					:							List[str]			=   image_size
												__lowercase					:							List[Any]			=   patch_size
												__lowercase					:							str			=   num_channels
												__lowercase					:							Dict			=   is_training
												__lowercase					:							Optional[int]			=   use_labels
												__lowercase					:							Union[str, Any]			=   hidden_size
												__lowercase					:							Optional[Any]			=   num_hidden_layers
												__lowercase					:							int			=   num_attention_heads
												__lowercase					:							int			=   intermediate_size
												__lowercase					:							List[Any]			=   hidden_act
												__lowercase					:							Optional[int]			=   hidden_dropout_prob
												__lowercase					:							Union[str, Any]			=   attention_probs_dropout_prob
												__lowercase					:							Union[str, Any]			=   type_sequence_label_size
												__lowercase					:							Optional[Any]			=   initializer_range
												__lowercase					:							List[Any]			=   encoder_stride
												__lowercase					:							str			=   num_attention_outputs
												__lowercase					:							Tuple			=   embed_dim
												__lowercase					:							Tuple			=   embed_dim + 1
												__lowercase					:							List[str]			=   resolution
												__lowercase					:							Optional[Any]			=   depths
												__lowercase					:							Dict			=   hidden_sizes
												__lowercase					:							Union[str, Any]			=   dim
												__lowercase					:							str			=   mlp_expansion_ratio



					def 					lowerCAmelCase (     self :		int							)	->     int:


												"""simple docstring"""

												__lowercase					:							str			=   floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]							)

												__lowercase					:							Optional[int]			=   None
												if self.use_labels:
																			__lowercase					:							Dict			=   ids_tensor([self.batch_size]						,   self.type_sequence_label_size							)

												__lowercase					:							List[Any]			=   self.get_config()

												return config, pixel_values, labels



					def 					lowerCAmelCase (     self :		List[str]							)	->     Tuple:


												"""simple docstring"""

												return EfficientFormerConfig(
												    image_size=self.image_size						,   patch_size=self.patch_size						,   num_channels=self.num_channels						,   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						,   is_decoder=__a						,   initializer_range=self.initializer_range						,   encoder_stride=self.encoder_stride						,   resolution=self.resolution						,   depths=self.depths						,   hidden_sizes=self.hidden_sizes						,   dim=self.dim						,   mlp_expansion_ratio=self.mlp_expansion_ratio						,   )



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


												"""simple docstring"""

												__lowercase					:							List[Any]			=   TFEfficientFormerModel(config=__a							)
												__lowercase					:							Optional[int]			=   model(__a						,   training=__a							)
												self.parent.assertEqual(result.last_hidden_state.shape						,   (self.batch_size, self.seq_length, self.hidden_size)							)



					def 					lowerCAmelCase (     self :		Optional[Any]						,   __a :		Tuple						,   __a :		Tuple						,   __a :		Tuple							)	->     Optional[int]:


												"""simple docstring"""

												__lowercase					:							List[Any]			=   self.type_sequence_label_size
												__lowercase					:							Optional[Any]			=   TFEfficientFormerForImageClassification(__a							)
												__lowercase					:							Union[str, Any]			=   model(__a						,   labels=__a						,   training=__a							)
												self.parent.assertEqual(result.logits.shape						,   (self.batch_size, self.type_sequence_label_size)							)

												# test greyscale images
												__lowercase					:							Optional[Any]			=   1
												__lowercase					:							int			=   TFEfficientFormerForImageClassification(__a							)

												__lowercase					:							List[str]			=   floats_tensor([self.batch_size, 1, self.image_size, self.image_size]							)
												__lowercase					:							int			=   model(__a						,   labels=__a							)
												self.parent.assertEqual(result.logits.shape						,   (self.batch_size, self.type_sequence_label_size)							)



					def 					lowerCAmelCase (     self :		Optional[int]							)	->     List[str]:


												"""simple docstring"""

												__lowercase					:							Tuple			=   self.prepare_config_and_inputs()
												__lowercase	,	__lowercase	,	__lowercase					:							Union[str, Any]			=   config_and_inputs
												__lowercase					:							Any			=   {"""pixel_values""": pixel_values}
												return config, inputs_dict







@require_tf
class 						lowerCAmelCase   (       __a					,				__a					,				unittest.TestCase	):

					'''simple docstring'''

					_A  :	Union[str, Any]     =					(
					    (
					        TFEfficientFormerModel,
					        TFEfficientFormerForImageClassificationWithTeacher,
					        TFEfficientFormerForImageClassification,
					    )
					    if is_tf_available()
					    else ()
					)
					_A  :	List[str]     =					(
					    {
					        '''feature-extraction''': TFEfficientFormerModel,
					        '''image-classification''': (
					            TFEfficientFormerForImageClassification,
					            TFEfficientFormerForImageClassificationWithTeacher,
					        ),
					    }
					    if is_tf_available()
					    else {}
					)

					_A  :	Any     =					False

					_A  :	Optional[int]     =					False
					_A  :	Dict     =					False
					_A  :	List[Any]     =					False
					_A  :	int     =					False



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


												"""simple docstring"""

												__lowercase					:							Optional[int]			=   TFEfficientFormerModelTester(self							)
												__lowercase					:							str			=   ConfigTester(
												    self						,   config_class=__a						,   has_text_modality=__a						,   hidden_size=37							)



					def 					lowerCAmelCase (     self :		List[str]							)	->     Optional[int]:


												"""simple docstring"""

												self.config_tester.run_common_tests()



					@unittest.skip(reason="""EfficientFormer does not use inputs_embeds"""							)
					def 					lowerCAmelCase (     self :		List[str]							)	->     List[str]:


												"""simple docstring"""

												pass



					@unittest.skip(reason="""EfficientFormer does not support input and output embeddings"""							)
					def 					lowerCAmelCase (     self :		List[Any]							)	->     List[str]:


												"""simple docstring"""

												pass



					def 					lowerCAmelCase (     self :		Optional[Any]							)	->     Any:


												"""simple docstring"""

												__lowercase	,	__lowercase					:							str			=   self.model_tester.prepare_config_and_inputs_for_common()

												for model_class in self.all_model_classes:
																			__lowercase					:							Optional[int]			=   model_class(__a							)
																			__lowercase					:							List[Any]			=   inspect.signature(model.call							)
																			# signature.parameters is an OrderedDict => so arg_names order is deterministic
																			__lowercase					:							str			=   [*signature.parameters.keys()]

																			__lowercase					:							int			=   ["""pixel_values"""]
																			self.assertListEqual(arg_names[:1]						,   __a							)



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


												"""simple docstring"""

												def check_hidden_states_output(__a :		Any						,   __a :		str						,   __a :		Any							):
																			__lowercase					:							Dict			=   model_class(__a							)

																			__lowercase					:							Tuple			=   model(**self._prepare_for_class(__a						,   __a							)						,   training=__a							)
																			__lowercase					:							int			=   outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

																			__lowercase					:							Dict			=   getattr(
																			    self.model_tester						,   """expected_num_hidden_layers"""						,   self.model_tester.num_hidden_layers + 1							)
																			self.assertEqual(len(__a							)						,   __a							)

																			if hasattr(self.model_tester						,   """encoder_seq_length"""							):
																										__lowercase					:							Union[str, Any]			=   self.model_tester.encoder_seq_length
																										if hasattr(self.model_tester						,   """chunk_length"""							) and self.model_tester.chunk_length > 1:
																																	__lowercase					:							str			=   seq_length * self.model_tester.chunk_length
																			else:
																										__lowercase					:							Union[str, Any]			=   self.model_tester.seq_length

																			self.assertListEqual(
																			    list(hidden_states[-1].shape[-2:]							)						,   [seq_length, self.model_tester.hidden_size]						,   )

																			if config.is_encoder_decoder:
																										__lowercase					:							Union[str, Any]			=   outputs.decoder_hidden_states

																										self.asseretIsInstance(__a						,   (list, tuple)							)
																										self.assertEqual(len(__a							)						,   __a							)
																										__lowercase					:							List[str]			=   getattr(self.model_tester						,   """seq_length"""						,   __a							)
																										__lowercase					:							Tuple			=   getattr(self.model_tester						,   """decoder_seq_length"""						,   __a							)

																										self.assertListEqual(
																										    list(hidden_states[-1].shape[-2:]							)						,   [decoder_seq_length, self.model_tester.hidden_size]						,   )

												__lowercase	,	__lowercase					:							Any			=   self.model_tester.prepare_config_and_inputs_for_common()

												for model_class in self.all_model_classes:
																			__lowercase					:							int			=   True
																			check_hidden_states_output(__a						,   __a						,   __a							)

																			# check that output_hidden_states also work using config
																			del inputs_dict["output_hidden_states"]
																			__lowercase					:							Optional[Any]			=   True

																			check_hidden_states_output(__a						,   __a						,   __a							)



					def 					lowerCAmelCase (     self :		Any						,   __a :		Optional[int]						,   __a :		List[Any]						,   __a :		Optional[int]=False							)	->     int:


												"""simple docstring"""

												__lowercase					:							Any			=   super()._prepare_for_class(__a						,   __a						,   return_labels=__a							)

												if return_labels:
																			if model_class.__name__ == "TFEfficientFormerForImageClassificationWithTeacher":
																										del inputs_dict["labels"]

												return inputs_dict



					def 					lowerCAmelCase (     self :		str							)	->     Any:


												"""simple docstring"""

												__lowercase					:							Optional[int]			=   self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_model(*__a							)



					@unittest.skip(reason="""EfficientFormer does not implement masked image modeling yet"""							)
					def 					lowerCAmelCase (     self :		Tuple							)	->     List[str]:


												"""simple docstring"""

												__lowercase					:							Tuple			=   self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_masked_image_modeling(*__a							)



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


												"""simple docstring"""

												__lowercase					:							List[str]			=   self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_image_classification(*__a							)



					@slow
					def 					lowerCAmelCase (     self :		Any							)	->     int:


												"""simple docstring"""

												for model_name in TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																			__lowercase					:							Any			=   TFEfficientFormerModel.from_pretrained(__a							)
																			self.assertIsNotNone(__a							)



					def 					lowerCAmelCase (     self :		Dict							)	->     str:


												"""simple docstring"""

												__lowercase	,	__lowercase					:							List[Any]			=   self.model_tester.prepare_config_and_inputs_for_common()
												__lowercase					:							int			=   True

												__lowercase					:							Optional[int]			=   getattr(self.model_tester						,   """seq_length"""						,   __a							)
												__lowercase					:							List[Any]			=   getattr(self.model_tester						,   """encoder_seq_length"""						,   __a							)
												__lowercase					:							str			=   getattr(self.model_tester						,   """key_length"""						,   __a							)
												__lowercase					:							Any			=   getattr(self.model_tester						,   """chunk_length"""						,   __a							)

												if chunk_length is not None and hasattr(self.model_tester						,   """num_hashes"""							):
																			__lowercase					:							Optional[int]			=   encoder_seq_length * self.model_tester.num_hashes

												for model_class in self.all_model_classes:
																			__lowercase					:							Union[str, Any]			=   True
																			__lowercase					:							Tuple			=   False
																			__lowercase					:							List[str]			=   True
																			__lowercase					:							int			=   model_class(__a							)

																			__lowercase					:							str			=   model(**self._prepare_for_class(__a						,   __a							)						,   training=__a							)
																			__lowercase					:							Union[str, Any]			=   outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions
																			self.assertEqual(len(__a							)						,   self.model_tester.num_attention_outputs							)

																			# check that output_attentions also work using config
																			del inputs_dict["output_attentions"]
																			__lowercase					:							str			=   True
																			__lowercase					:							Any			=   model_class(__a							)
																			__lowercase					:							List[str]			=   model(**self._prepare_for_class(__a						,   __a							)						,   training=__a							)

																			__lowercase					:							Optional[Any]			=   outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions
																			self.assertEqual(len(__a							)						,   self.model_tester.num_attention_outputs							)

																			if chunk_length is not None:
																										self.assertListEqual(
																										    list(attentions[0].shape[-4:]							)						,   [self.model_tester.num_attention_heads, encoder_seq_length, chunk_length, encoder_key_length]						,   )
																			else:
																										self.assertListEqual(
																										    list(attentions[0].shape[-3:]							)						,   [self.model_tester.num_attention_heads, encoder_seq_length, encoder_key_length]						,   )



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


												"""simple docstring"""

												__lowercase	,	__lowercase					:							Union[str, Any]			=   self.model_tester.prepare_config_and_inputs_for_common()

												for model_class in self.all_model_classes:
																			# Prepare our model
																			__lowercase					:							List[str]			=   model_class(__a							)
																			# These are maximally general inputs for the model, with multiple None dimensions
																			# Hopefully this will catch any conditionals that fail for flexible shapes
																			__lowercase					:							List[str]			=   {
																			    key: tf.keras.Input(shape=val.shape[1:]						,   dtype=val.dtype						,   name=__a							)
																			    for key, val in model.input_signature.items()
																			    if key in model.dummy_inputs
																			}
																			__lowercase					:							List[str]			=   model(__a							)
																			self.assertTrue(outputs_dict is not None							)







def 					snake_case_						(   ):
							__lowercase					:							Optional[int]			=   Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""					)
							return image



@require_tf
@require_vision
class 						lowerCAmelCase   (       unittest.TestCase	):

					'''simple docstring'''

					@cached_property
					def 					lowerCAmelCase (     self :		int							)	->     str:


												"""simple docstring"""

												return (
												    EfficientFormerImageProcessor.from_pretrained("""snap-research/efficientformer-l1-300"""							)
												    if is_vision_available()
												    else None
												)



					@slow
					def 					lowerCAmelCase (     self :		str							)	->     int:


												"""simple docstring"""

												__lowercase					:							int			=   TFEfficientFormerForImageClassification.from_pretrained("""snap-research/efficientformer-l1-300"""							)
												__lowercase					:							Optional[Any]			=   self.default_image_processor
												__lowercase					:							Optional[int]			=   prepare_img()
												__lowercase					:							List[str]			=   image_processor(images=__a						,   return_tensors="""tf"""							)
												# forward pass
												__lowercase					:							int			=   model(**__a						,   training=__a							)
												# verify the logits
												__lowercase					:							Union[str, Any]			=   tf.TensorShape((1, 1000)							)
												self.assertEqual(outputs.logits.shape						,   __a							)
												__lowercase					:							Optional[Any]			=   tf.constant([-0.0555, 0.4825, -0.0852]							)
												self.assertTrue(np.allclose(outputs.logits[0, :3]						,   __a						,   atol=1E-4							)							)



					@slow
					def 					lowerCAmelCase (     self :		Any							)	->     Optional[int]:


												"""simple docstring"""

												__lowercase					:							Dict			=   TFEfficientFormerForImageClassificationWithTeacher.from_pretrained(
												    """snap-research/efficientformer-l1-300"""							)
												__lowercase					:							Optional[int]			=   self.default_image_processor
												__lowercase					:							List[Any]			=   prepare_img()
												__lowercase					:							Any			=   image_processor(images=__a						,   return_tensors="""tf"""							)
												# forward pass
												__lowercase					:							List[str]			=   model(**__a						,   training=__a							)
												# verify the logits
												__lowercase					:							Any			=   tf.TensorShape((1, 1000)							)
												self.assertEqual(outputs.logits.shape						,   __a							)
												__lowercase					:							List[str]			=   tf.constant([-0.1312, 0.4353, -1.0499]							)
												self.assertTrue(np.allclose(outputs.logits[0, :3]						,   __a						,   atol=1E-4							)							)







import unittest

from transformers import CamembertTokenizer, CamembertTokenizerFast
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow
from transformers.utils import is_torch_available

from ...test_tokenization_common import TokenizerTesterMixin


lowerCamelCase       :       Any        =				get_tests_dir('''fixtures/test_sentencepiece.model''')
lowerCamelCase       :       Any        =				get_tests_dir('''fixtures/test_sentencepiece_bpe.model''')

lowerCamelCase       :       Optional[int]        =				'''pt''' if is_torch_available() else '''tf'''

@require_sentencepiece
@require_tokenizers
class 						lowerCAmelCase   (       __a					,				unittest.TestCase	):

					'''simple docstring'''

					_A  :	Dict     =					CamembertTokenizer
					_A  :	Union[str, Any]     =					CamembertTokenizerFast
					_A  :	Union[str, Any]     =					True
					_A  :	Tuple     =					True



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


												"""simple docstring"""

												super().setUp()

												# We have a SentencePiece fixture for testing
												__lowercase					:							Union[str, Any]			=   CamembertTokenizer(__a							)
												tokenizer.save_pretrained(self.tmpdirname							)



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


												"""simple docstring"""

												__lowercase					:							Dict			=   """<pad>"""
												__lowercase					:							Dict			=   1

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



					def 					lowerCAmelCase (     self :		Optional[Any]							)	->     Tuple:


												"""simple docstring"""

												__lowercase					:							int			=   list(self.get_tokenizer().get_vocab().keys()							)

												self.assertEqual(vocab_keys[0]						,   """<s>NOTUSED"""							)
												self.assertEqual(vocab_keys[1]						,   """<pad>"""							)
												self.assertEqual(vocab_keys[-1]						,   """<mask>"""							)
												self.assertEqual(len(__a							)						,   1004							)



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


												"""simple docstring"""

												self.assertEqual(self.get_tokenizer().vocab_size						,   1005							)



					def 					lowerCAmelCase (     self :		Any							)	->     Optional[Any]:


												"""simple docstring"""

												__lowercase					:							Tuple			=   CamembertTokenizer(__a							)
												tokenizer.save_pretrained(self.tmpdirname							)
												__lowercase					:							Tuple			=   CamembertTokenizerFast.from_pretrained(self.tmpdirname							)

												__lowercase					:							List[str]			=   """I was born in 92000, and this is falsé."""

												__lowercase					:							Optional[Any]			=   tokenizer.encode(__a							)
												__lowercase					:							List[Any]			=   rust_tokenizer.encode(__a							)
												self.assertListEqual(__a						,   __a							)

												__lowercase					:							Tuple			=   tokenizer.encode(__a						,   add_special_tokens=__a							)
												__lowercase					:							Union[str, Any]			=   rust_tokenizer.encode(__a						,   add_special_tokens=__a							)
												self.assertListEqual(__a						,   __a							)

												# <unk> tokens are not the same for `rust` than for `slow`.
												# Because spm gives back raw token instead of `unk` in EncodeAsPieces
												# tokens = tokenizer.tokenize(sequence)
												__lowercase					:							Dict			=   tokenizer.convert_ids_to_tokens(__a							)
												__lowercase					:							Any			=   rust_tokenizer.tokenize(__a							)
												self.assertListEqual(__a						,   __a							)



					def 					lowerCAmelCase (     self :		Any							)	->     Dict:


												"""simple docstring"""

												if not self.test_rust_tokenizer:
																			return

												__lowercase					:							List[str]			=   self.get_tokenizer()
												__lowercase					:							Any			=   self.get_rust_tokenizer()

												__lowercase					:							Any			=   """I was born in 92000, and this is falsé."""

												__lowercase					:							Tuple			=   tokenizer.tokenize(__a							)
												__lowercase					:							Optional[Any]			=   rust_tokenizer.tokenize(__a							)
												self.assertListEqual(__a						,   __a							)

												__lowercase					:							Dict			=   tokenizer.encode(__a						,   add_special_tokens=__a							)
												__lowercase					:							Dict			=   rust_tokenizer.encode(__a						,   add_special_tokens=__a							)
												self.assertListEqual(__a						,   __a							)

												__lowercase					:							Any			=   self.get_rust_tokenizer()
												__lowercase					:							str			=   tokenizer.encode(__a							)
												__lowercase					:							Union[str, Any]			=   rust_tokenizer.encode(__a							)
												self.assertListEqual(__a						,   __a							)



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


												"""simple docstring"""

												__lowercase					:							str			=   {"""input_ids""": [[5, 54, 7196, 297, 30, 23, 776, 18, 11, 3215, 3705, 8252, 22, 3164, 1181, 2116, 29, 16, 813, 25, 791, 3314, 20, 3446, 38, 27575, 120, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [5, 468, 17, 11, 9088, 20, 1517, 8, 22804, 18818, 10, 38, 629, 607, 607, 142, 19, 7196, 867, 56, 10326, 24, 2267, 20, 416, 5072, 15612, 233, 734, 7, 2399, 27, 16, 3015, 1649, 7, 24, 20, 4338, 2399, 27, 13, 3400, 14, 13, 6189, 8, 930, 9, 6]], """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, 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]]}  # noqa: E501
												# fmt: on

												# camembert is a french model. So we also use french texts.
												__lowercase					:							List[str]			=   [
												    """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=__a						,   model_name="""camembert-base"""						,   revision="""3a0641d9a1aeb7e848a74299e7e4c4bca216b4cf"""						,   sequences=__a						,   )