
import unittest

from transformers import MobileBertConfig, 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,
		    MobileBertForMaskedLM,
		    MobileBertForMultipleChoice,
		    MobileBertForNextSentencePrediction,
		    MobileBertForPreTraining,
		    MobileBertForQuestionAnswering,
		    MobileBertForSequenceClassification,
		    MobileBertForTokenClassification,
		    MobileBertModel,
		)




class 				lowerCamelCase__							:




	'''simple docstring'''




	def __init__(      self	:Optional[int]  ,     a	:Optional[int]  ,     a	:List[Any]=1_3  ,     a	:str=7  ,     a	:int=True  ,     a	:Union[str, Any]=True  ,     a	:Any=True  ,     a	:Tuple=True  ,     a	:List[str]=9_9  ,     a	:str=6_4  ,     a	:List[Any]=3_2  ,     a	:List[Any]=5  ,     a	:Optional[Any]=4  ,     a	:Optional[int]=3_7  ,     a	:Union[str, Any]="gelu"  ,     a	:str=0.1  ,     a	:List[str]=0.1  ,     a	:Any=5_1_2  ,     a	:Dict=1_6  ,     a	:int=2  ,     a	:List[str]=0.02  ,     a	:Optional[Any]=3  ,     a	:Dict=4  ,     a	:List[str]=None  ,     )	->				Union[str, Any]:
								__UpperCamelCase			:     List[Any]         =      parent
								__UpperCamelCase			:     List[Any]         =      batch_size
								__UpperCamelCase			:     Union[str, Any]         =      seq_length
								__UpperCamelCase			:     Optional[int]         =      is_training
								__UpperCamelCase			:     List[str]         =      use_input_mask
								__UpperCamelCase			:     List[str]         =      use_token_type_ids
								__UpperCamelCase			:     Tuple         =      use_labels
								__UpperCamelCase			:     Optional[Any]         =      vocab_size
								__UpperCamelCase			:     int         =      hidden_size
								__UpperCamelCase			:     Any         =      embedding_size
								__UpperCamelCase			:     Any         =      num_hidden_layers
								__UpperCamelCase			:     str         =      num_attention_heads
								__UpperCamelCase			:     Tuple         =      intermediate_size
								__UpperCamelCase			:     Optional[Any]         =      hidden_act
								__UpperCamelCase			:     List[Any]         =      hidden_dropout_prob
								__UpperCamelCase			:     Optional[Any]         =      attention_probs_dropout_prob
								__UpperCamelCase			:     int         =      max_position_embeddings
								__UpperCamelCase			:     Any         =      type_vocab_size
								__UpperCamelCase			:     Dict         =      type_sequence_label_size
								__UpperCamelCase			:     Union[str, Any]         =      initializer_range
								__UpperCamelCase			:     str         =      num_labels
								__UpperCamelCase			:     Union[str, Any]         =      num_choices
								__UpperCamelCase			:     Dict         =      scope







	def      _lowerCamelCase       (      self	:Optional[Any]		)	->				Optional[Any]:
								__UpperCamelCase			:     List[Any]         =      ids_tensor([self.batch_size, self.seq_length]  ,     self.vocab_size		)

								__UpperCamelCase			:     Union[str, Any]         =      None
								if self.use_input_mask:
															__UpperCamelCase			:     str         =      random_attention_mask([self.batch_size, self.seq_length]		)

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

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

								__UpperCamelCase			:     str         =      self.get_config()

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







	def      _lowerCamelCase       (      self	:Optional[int]		)	->				Optional[int]:
								return MobileBertConfig(
								    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=a  ,     initializer_range=self.initializer_range  ,     )







	def      _lowerCamelCase       (      self	:int  ,     a	:str  ,     a	:Union[str, Any]  ,     a	:Optional[int]  ,     a	:int  ,     a	:Optional[Any]  ,     a	:List[Any]  ,     a	:str		)	->				Tuple:
								__UpperCamelCase			:     Union[str, Any]         =      MobileBertModel(config=a		)
								model.to(a		)
								model.eval()
								__UpperCamelCase			:     Optional[int]         =      model(a  ,     attention_mask=a  ,     token_type_ids=a		)
								__UpperCamelCase			:     List[Any]         =      model(a  ,     token_type_ids=a		)
								__UpperCamelCase			:     int         =      model(a		)

								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      _lowerCamelCase       (      self	:Any  ,     a	:List[Any]  ,     a	:Tuple  ,     a	:List[Any]  ,     a	:List[Any]  ,     a	:int  ,     a	:int  ,     a	:Union[str, Any]		)	->				Dict:
								__UpperCamelCase			:     Any         =      MobileBertForMaskedLM(config=a		)
								model.to(a		)
								model.eval()
								__UpperCamelCase			:     List[Any]         =      model(a  ,     attention_mask=a  ,     token_type_ids=a  ,     labels=a		)
								self.parent.assertEqual(result.logits.shape  ,     (self.batch_size, self.seq_length, self.vocab_size)		)







	def      _lowerCamelCase       (      self	:Tuple  ,     a	:int  ,     a	:List[Any]  ,     a	:List[str]  ,     a	:List[Any]  ,     a	:Tuple  ,     a	:List[str]  ,     a	:Optional[Any]		)	->				Tuple:
								__UpperCamelCase			:     int         =      MobileBertForNextSentencePrediction(config=a		)
								model.to(a		)
								model.eval()
								__UpperCamelCase			:     List[str]         =      model(
								    a  ,     attention_mask=a  ,     token_type_ids=a  ,     labels=a  ,     )
								self.parent.assertEqual(result.logits.shape  ,     (self.batch_size, 2)		)







	def      _lowerCamelCase       (      self	:Union[str, Any]  ,     a	:Optional[int]  ,     a	:str  ,     a	:Optional[Any]  ,     a	:List[str]  ,     a	:Union[str, Any]  ,     a	:Tuple  ,     a	:Tuple		)	->				List[str]:
								__UpperCamelCase			:     int         =      MobileBertForPreTraining(config=a		)
								model.to(a		)
								model.eval()
								__UpperCamelCase			:     Tuple         =      model(
								    a  ,     attention_mask=a  ,     token_type_ids=a  ,     labels=a  ,     next_sentence_label=a  ,     )
								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      _lowerCamelCase       (      self	:List[str]  ,     a	:List[str]  ,     a	:str  ,     a	:Tuple  ,     a	:List[Any]  ,     a	:Any  ,     a	:str  ,     a	:int		)	->				Optional[Any]:
								__UpperCamelCase			:     Union[str, Any]         =      MobileBertForQuestionAnswering(config=a		)
								model.to(a		)
								model.eval()
								__UpperCamelCase			:     str         =      model(
								    a  ,     attention_mask=a  ,     token_type_ids=a  ,     start_positions=a  ,     end_positions=a  ,     )
								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      _lowerCamelCase       (      self	:Optional[int]  ,     a	:List[Any]  ,     a	:str  ,     a	:List[str]  ,     a	:Tuple  ,     a	:Any  ,     a	:List[Any]  ,     a	:List[Any]		)	->				List[Any]:
								__UpperCamelCase			:     Optional[Any]         =      self.num_labels
								__UpperCamelCase			:     Optional[int]         =      MobileBertForSequenceClassification(a		)
								model.to(a		)
								model.eval()
								__UpperCamelCase			:     Dict         =      model(a  ,     attention_mask=a  ,     token_type_ids=a  ,     labels=a		)
								self.parent.assertEqual(result.logits.shape  ,     (self.batch_size, self.num_labels)		)







	def      _lowerCamelCase       (      self	:int  ,     a	:Dict  ,     a	:List[Any]  ,     a	:int  ,     a	:List[str]  ,     a	:Dict  ,     a	:Tuple  ,     a	:List[Any]		)	->				Dict:
								__UpperCamelCase			:     str         =      self.num_labels
								__UpperCamelCase			:     Optional[int]         =      MobileBertForTokenClassification(config=a		)
								model.to(a		)
								model.eval()
								__UpperCamelCase			:     Any         =      model(a  ,     attention_mask=a  ,     token_type_ids=a  ,     labels=a		)
								self.parent.assertEqual(result.logits.shape  ,     (self.batch_size, self.seq_length, self.num_labels)		)







	def      _lowerCamelCase       (      self	:Optional[Any]  ,     a	:List[str]  ,     a	:Tuple  ,     a	:List[Any]  ,     a	:Tuple  ,     a	:int  ,     a	:List[Any]  ,     a	:List[str]		)	->				Tuple:
								__UpperCamelCase			:     Tuple         =      self.num_choices
								__UpperCamelCase			:     Any         =      MobileBertForMultipleChoice(config=a		)
								model.to(a		)
								model.eval()
								__UpperCamelCase			:     Any         =      input_ids.unsqueeze(1		).expand(-1  ,     self.num_choices  ,     -1		).contiguous()
								__UpperCamelCase			:     int         =      token_type_ids.unsqueeze(1		).expand(-1  ,     self.num_choices  ,     -1		).contiguous()
								__UpperCamelCase			:     List[str]         =      input_mask.unsqueeze(1		).expand(-1  ,     self.num_choices  ,     -1		).contiguous()
								__UpperCamelCase			:     Dict         =      model(
								    a  ,     attention_mask=a  ,     token_type_ids=a  ,     labels=a  ,     )
								self.parent.assertEqual(result.logits.shape  ,     (self.batch_size, self.num_choices)		)







	def      _lowerCamelCase       (      self	:List[str]		)	->				List[Any]:
								__UpperCamelCase			:     Tuple         =      self.prepare_config_and_inputs()
								(
								    __UpperCamelCase		
								)			:     List[str]         =      config_and_inputs
								__UpperCamelCase			:     Optional[Any]         =      {"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
								return config, inputs_dict




@require_torch
class 				lowerCamelCase__							(       __lowercase  ,		__lowercase  ,		unittest.TestCase):




	'''simple docstring'''




	_A			=  (
	    (
	        MobileBertModel,
	        MobileBertForMaskedLM,
	        MobileBertForMultipleChoice,
	        MobileBertForNextSentencePrediction,
	        MobileBertForPreTraining,
	        MobileBertForQuestionAnswering,
	        MobileBertForSequenceClassification,
	        MobileBertForTokenClassification,
	    )
	    if is_torch_available()
	    else ()
	)
	_A			=  (
	    {
	        'feature-extraction': MobileBertModel,
	        'fill-mask': MobileBertForMaskedLM,
	        'question-answering': MobileBertForQuestionAnswering,
	        'text-classification': MobileBertForSequenceClassification,
	        'token-classification': MobileBertForTokenClassification,
	        'zero-shot': MobileBertForSequenceClassification,
	    }
	    if is_torch_available()
	    else {}
	)
	_A			=  True







	def      _lowerCamelCase       (      self	:Any  ,     a	:Union[str, Any]  ,     a	:Tuple  ,     a	:Tuple=False		)	->				List[Any]:
								__UpperCamelCase			:     str         =      super()._prepare_for_class(a  ,     a  ,     return_labels=a		)

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







	def      _lowerCamelCase       (      self	:List[Any]		)	->				Optional[Any]:
								__UpperCamelCase			:     str         =      MobileBertModelTester(self		)
								__UpperCamelCase			:     str         =      ConfigTester(self  ,     config_class=a  ,     hidden_size=3_7		)







	def      _lowerCamelCase       (      self	:Optional[int]		)	->				Tuple:
								self.config_tester.run_common_tests()







	def      _lowerCamelCase       (      self	:Optional[int]		)	->				str:
								__UpperCamelCase			:     Optional[Any]         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mobilebert_model(*a		)







	def      _lowerCamelCase       (      self	:Optional[int]		)	->				List[str]:
								__UpperCamelCase			:     int         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mobilebert_for_masked_lm(*a		)







	def      _lowerCamelCase       (      self	:Tuple		)	->				int:
								__UpperCamelCase			:     Dict         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mobilebert_for_multiple_choice(*a		)







	def      _lowerCamelCase       (      self	:Any		)	->				Optional[int]:
								__UpperCamelCase			:     str         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mobilebert_for_next_sequence_prediction(*a		)







	def      _lowerCamelCase       (      self	:Any		)	->				Optional[Any]:
								__UpperCamelCase			:     Optional[int]         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mobilebert_for_pretraining(*a		)







	def      _lowerCamelCase       (      self	:Any		)	->				Optional[Any]:
								__UpperCamelCase			:     Optional[Any]         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mobilebert_for_question_answering(*a		)







	def      _lowerCamelCase       (      self	:int		)	->				int:
								__UpperCamelCase			:     Dict         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mobilebert_for_sequence_classification(*a		)







	def      _lowerCamelCase       (      self	:Union[str, Any]		)	->				Dict:
								__UpperCamelCase			:     List[Any]         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mobilebert_for_token_classification(*a		)




def 			_SCREAMING_SNAKE_CASE      (	_lowerCamelCase				:    Tuple)      ->					str:






							'''simple docstring'''





							return torch.tensor(
							    _lowerCamelCase       ,						dtype=torch.long       ,						device=_lowerCamelCase       ,						)


lowercase						:      List[str]									= 1E-3




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




	'''simple docstring'''




	@slow
	def      _lowerCamelCase       (      self	:Optional[Any]		)	->				List[Any]:
								__UpperCamelCase			:     str         =      MobileBertModel.from_pretrained("google/mobilebert-uncased"		).to(a		)
								__UpperCamelCase			:     List[str]         =      _long_tensor([[1_0_1, 7_1_1_0, 1_0_0_5, 1_0_5_6, 2_0_2_3, 1_1_3_3_3, 1_7_4_1_3, 1_0_2_9, 1_0_2]]		)
								with torch.no_grad():
															__UpperCamelCase			:     Optional[int]         =      model(a		)[0]
								__UpperCamelCase			:     Optional[int]         =      torch.Size((1, 9, 5_1_2)		)
								self.assertEqual(output.shape  ,     a		)
								__UpperCamelCase			:     Any         =      torch.tensor(
								    [
								        [
								            [-2.4_7_3_6_5_2_6E0_7, 8.2_6_9_1_6_5_6E0_4, 1.6_5_2_1_8_3_8E0_5],
								            [-5.7_5_4_1_7_0_4E-0_1, 3.9_0_5_6_0_2_2E0_0, 4.4_0_1_1_5_0_7E0_0],
								            [2.6_0_4_7_3_5_9E0_0, 1.5_6_7_7_6_5_2E0_0, -1.7_3_2_4_1_8_8E-0_1],
								        ]
								    ]  ,     device=a  ,     )

								# MobileBERT results range from 10e0 to 10e8. Even a 0.0000001% difference with a value of 10e8 results in a
								# ~1 difference, it's therefore not a good idea to measure using addition.
								# Here, we instead divide the expected result with the result in order to obtain ~1. We then check that the
								# result is held between bounds: 1 - TOLERANCE < expected_result / result < 1 + TOLERANCE
								__UpperCamelCase			:     Union[str, Any]         =      torch.all((expected_slice / output[..., :3, :3]) >= 1 - TOLERANCE		)
								__UpperCamelCase			:     List[Any]         =      torch.all((expected_slice / output[..., :3, :3]) <= 1 + TOLERANCE		)

								self.assertTrue(lower_bound and upper_bound		)

# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from packaging import version

from .. import __version__
from .constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_STANDARD_MEAN, IMAGENET_STANDARD_STD
from .doc import (
    add_code_sample_docstrings,
    add_end_docstrings,
    add_start_docstrings,
    add_start_docstrings_to_model_forward,
    copy_func,
    replace_return_docstrings,
)
from .generic import (
    ContextManagers,
    ExplicitEnum,
    ModelOutput,
    PaddingStrategy,
    TensorType,
    add_model_info_to_auto_map,
    cached_property,
    can_return_loss,
    expand_dims,
    find_labels,
    flatten_dict,
    infer_framework,
    is_jax_tensor,
    is_numpy_array,
    is_tensor,
    is_tf_symbolic_tensor,
    is_tf_tensor,
    is_torch_device,
    is_torch_dtype,
    is_torch_tensor,
    reshape,
    squeeze,
    strtobool,
    tensor_size,
    to_numpy,
    to_py_obj,
    transpose,
    working_or_temp_dir,
)
from .hub import (
    CLOUDFRONT_DISTRIB_PREFIX,
    DISABLE_TELEMETRY,
    HF_MODULES_CACHE,
    HUGGINGFACE_CO_PREFIX,
    HUGGINGFACE_CO_RESOLVE_ENDPOINT,
    PYTORCH_PRETRAINED_BERT_CACHE,
    PYTORCH_TRANSFORMERS_CACHE,
    S3_BUCKET_PREFIX,
    TRANSFORMERS_CACHE,
    TRANSFORMERS_DYNAMIC_MODULE_NAME,
    EntryNotFoundError,
    PushToHubMixin,
    RepositoryNotFoundError,
    RevisionNotFoundError,
    cached_file,
    default_cache_path,
    define_sagemaker_information,
    download_url,
    extract_commit_hash,
    get_cached_models,
    get_file_from_repo,
    get_full_repo_name,
    has_file,
    http_user_agent,
    is_offline_mode,
    is_remote_url,
    move_cache,
    send_example_telemetry,
    try_to_load_from_cache,
)
from .import_utils import (
    ENV_VARS_TRUE_AND_AUTO_VALUES,
    ENV_VARS_TRUE_VALUES,
    TORCH_FX_REQUIRED_VERSION,
    USE_JAX,
    USE_TF,
    USE_TORCH,
    DummyObject,
    OptionalDependencyNotAvailable,
    _LazyModule,
    ccl_version,
    direct_transformers_import,
    get_torch_version,
    is_accelerate_available,
    is_apex_available,
    is_bitsandbytes_available,
    is_bsa_available,
    is_coloredlogs_available,
    is_cython_available,
    is_datasets_available,
    is_decord_available,
    is_detectrona_available,
    is_faiss_available,
    is_flax_available,
    is_ftfy_available,
    is_in_notebook,
    is_ipex_available,
    is_jieba_available,
    is_jumanpp_available,
    is_kenlm_available,
    is_keras_nlp_available,
    is_librosa_available,
    is_natten_available,
    is_ninja_available,
    is_onnx_available,
    is_openai_available,
    is_optimum_available,
    is_pandas_available,
    is_peft_available,
    is_phonemizer_available,
    is_protobuf_available,
    is_psutil_available,
    is_pyanvml_available,
    is_pyctcdecode_available,
    is_pytesseract_available,
    is_pytest_available,
    is_pytorch_quantization_available,
    is_rjieba_available,
    is_sacremoses_available,
    is_safetensors_available,
    is_sagemaker_dp_enabled,
    is_sagemaker_mp_enabled,
    is_scipy_available,
    is_sentencepiece_available,
    is_seqio_available,
    is_sklearn_available,
    is_soundfile_availble,
    is_spacy_available,
    is_speech_available,
    is_sudachi_available,
    is_tensorflow_probability_available,
    is_tensorflow_text_available,
    is_tfaonnx_available,
    is_tf_available,
    is_timm_available,
    is_tokenizers_available,
    is_torch_available,
    is_torch_bfaa_available,
    is_torch_bfaa_cpu_available,
    is_torch_bfaa_gpu_available,
    is_torch_compile_available,
    is_torch_cuda_available,
    is_torch_fx_available,
    is_torch_fx_proxy,
    is_torch_mps_available,
    is_torch_neuroncore_available,
    is_torch_tensorrt_fx_available,
    is_torch_tfaa_available,
    is_torch_tpu_available,
    is_torchaudio_available,
    is_torchdistx_available,
    is_torchdynamo_available,
    is_torchvision_available,
    is_training_run_on_sagemaker,
    is_vision_available,
    requires_backends,
    torch_only_method,
)


lowercase						:      Any									= 'pytorch_model.bin'
lowercase						:      List[str]									= 'pytorch_model.bin.index.json'
lowercase						:      List[Any]									= 'adapter_config.json'
lowercase						:      str									= 'adapter_model.bin'
lowercase						:      List[str]									= 'adapter_model.safetensors'
lowercase						:      Any									= 'tf_model.h5'
lowercase						:      str									= 'tf_model.h5.index.json'
lowercase						:      Any									= 'model.ckpt'
lowercase						:      Optional[int]									= 'flax_model.msgpack'
lowercase						:      Dict									= 'flax_model.msgpack.index.json'
lowercase						:      Dict									= 'model.safetensors'
lowercase						:      Dict									= 'model.safetensors.index.json'
lowercase						:      Union[str, Any]									= 'config.json'
lowercase						:      Tuple									= 'preprocessor_config.json'
lowercase						:      Tuple									= FEATURE_EXTRACTOR_NAME
lowercase						:      Dict									= 'generation_config.json'
lowercase						:      Dict									= 'modelcard.json'

lowercase						:      Optional[int]									= '▁'
lowercase						:      Any									= SENTENCEPIECE_UNDERLINE  # Kept for backward compatibility

lowercase						:      List[Any]									= [
    [[0, 1, 0, 1], [1, 0, 0, 1]]
] * 2  # Needs to have 0s and 1s only since XLM uses it for langs too.
lowercase						:      Tuple									= [[7, 6, 0, 0, 1], [1, 2, 3, 0, 0], [0, 0, 0, 4, 5]]
lowercase						:      Any									= [[1, 1, 1, 1, 1], [1, 1, 1, 0, 0], [0, 0, 0, 1, 1]]




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






							'''simple docstring'''





							if version.parse(_lowerCamelCase) < version.parse(_lowerCamelCase):
														if "dev" in min_version:
																					__UpperCamelCase			:     List[str]         =      (
																					    "This example requires a source install from HuggingFace Transformers (see "
																					    "`https://huggingface.co/docs/transformers/installation#install-from-source`),"
																					)
														else:
																					__UpperCamelCase			:     Optional[Any]         =      F'This example requires a minimum version of {min_version},'
														error_message += F' but the version found is {__version__}.\n'
														raise ImportError(
														    error_message
														    + "Check out https://github.com/huggingface/transformers/tree/main/examples#important-note for the examples corresponding to other "
														    "versions of HuggingFace Transformers.")