





'''simple docstring'''






from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


A   : int             =			logging.get_logger(__name__)

A   : List[Any]             =			{
    'xlm-mlm-en-2048': 'https://huggingface.co/xlm-mlm-en-2048/resolve/main/config.json',
    'xlm-mlm-ende-1024': 'https://huggingface.co/xlm-mlm-ende-1024/resolve/main/config.json',
    'xlm-mlm-enfr-1024': 'https://huggingface.co/xlm-mlm-enfr-1024/resolve/main/config.json',
    'xlm-mlm-enro-1024': 'https://huggingface.co/xlm-mlm-enro-1024/resolve/main/config.json',
    'xlm-mlm-tlm-xnli15-1024': 'https://huggingface.co/xlm-mlm-tlm-xnli15-1024/resolve/main/config.json',
    'xlm-mlm-xnli15-1024': 'https://huggingface.co/xlm-mlm-xnli15-1024/resolve/main/config.json',
    'xlm-clm-enfr-1024': 'https://huggingface.co/xlm-clm-enfr-1024/resolve/main/config.json',
    'xlm-clm-ende-1024': 'https://huggingface.co/xlm-clm-ende-1024/resolve/main/config.json',
    'xlm-mlm-17-1280': 'https://huggingface.co/xlm-mlm-17-1280/resolve/main/config.json',
    'xlm-mlm-100-1280': 'https://huggingface.co/xlm-mlm-100-1280/resolve/main/config.json',
}







class 			lowerCamelCase					(						__UpperCAmelCase  ):
					_SCREAMING_SNAKE_CASE							   =    "xlm"
					_SCREAMING_SNAKE_CASE							   =    {
					    "hidden_size": "emb_dim",
					    "num_attention_heads": "n_heads",
					    "num_hidden_layers": "n_layers",
					    "n_words": "vocab_size",  # For backward compatibility
					}


					def __init__(					self	:  Dict       ,     __snake_case	:  Union[str, Any]=3_01_45       ,     __snake_case	:  Any=20_48       ,     __snake_case	:  Union[str, Any]=12       ,     __snake_case	:  Dict=16       ,     __snake_case	:  Optional[int]=0.1       ,     __snake_case	:  List[str]=0.1       ,     __snake_case	:  str=True       ,     __snake_case	:  Optional[Any]=False       ,     __snake_case	:  Dict=False       ,     __snake_case	:  Tuple=False       ,     __snake_case	:  str=1       ,     __snake_case	:  Dict=True       ,     __snake_case	:  List[str]=5_12       ,     __snake_case	:  Dict=20_48**-0.5       ,     __snake_case	:  int=1e-12       ,     __snake_case	:  Any=0.02       ,     __snake_case	:  Optional[int]=0       ,     __snake_case	:  List[Any]=1       ,     __snake_case	:  Dict=2       ,     __snake_case	:  Union[str, Any]=3       ,     __snake_case	:  Optional[int]=5       ,     __snake_case	:  Tuple=True       ,     __snake_case	:  Optional[Any]="first"       ,     __snake_case	:  Any=True       ,     __snake_case	:  str=None       ,     __snake_case	:  Tuple=True       ,     __snake_case	:  Optional[Any]=0.1       ,     __snake_case	:  Any=5       ,     __snake_case	:  Dict=5       ,     __snake_case	:  str=0       ,     __snake_case	:  int=0       ,     __snake_case	:  str=2       ,     __snake_case	:  Any=0       ,     **__snake_case	:  Optional[Any]       ,     ):





											'''simple docstring'''





											_snake_case:   Optional[int]  					=		vocab_size
											_snake_case:   str  					=		emb_dim
											_snake_case:   Union[str, Any]  					=		n_layers
											_snake_case:   str  					=		n_heads
											_snake_case:   Tuple  					=		dropout
											_snake_case:   Dict  					=		attention_dropout
											_snake_case:   int  					=		gelu_activation
											_snake_case:   Optional[int]  					=		sinusoidal_embeddings
											_snake_case:   Optional[int]  					=		causal
											_snake_case:   str  					=		asm
											_snake_case:   Tuple  					=		n_langs
											_snake_case:   Tuple  					=		use_lang_emb
											_snake_case:   List[str]  					=		layer_norm_eps
											_snake_case:   Union[str, Any]  					=		bos_index
											_snake_case:   Optional[Any]  					=		eos_index
											_snake_case:   Any  					=		pad_index
											_snake_case:   Dict  					=		unk_index
											_snake_case:   Optional[Any]  					=		mask_index
											_snake_case:   List[Any]  					=		is_encoder
											_snake_case:   str  					=		max_position_embeddings
											_snake_case:   Optional[int]  					=		embed_init_std
											_snake_case:   List[Any]  					=		init_std
											_snake_case:   int  					=		summary_type
											_snake_case:   int  					=		summary_use_proj
											_snake_case:   Tuple  					=		summary_activation
											_snake_case:   Any  					=		summary_proj_to_labels
											_snake_case:   str  					=		summary_first_dropout
											_snake_case:   Any  					=		start_n_top
											_snake_case:   Dict  					=		end_n_top
											_snake_case:   Optional[int]  					=		mask_token_id
											_snake_case:   int  					=		lang_id

											if "n_words" in kwargs:
																	_snake_case:   int  					=		kwargs['n_words']

											super().__init__(pad_token_id=__snake_case       ,     bos_token_id=__snake_case       ,     **__snake_case       )







class 			lowerCamelCase					(						__UpperCAmelCase  ):


					@property
					def    SCREAMING_SNAKE_CASE_		(					self	:  List[Any]       ):





											'''simple docstring'''





											if self.task == "multiple-choice":
																	_snake_case:   Union[str, Any]  					=		{0: 'batch', 1: 'choice', 2: 'sequence'}
											else:
																	_snake_case:   Optional[int]  					=		{0: 'batch', 1: 'sequence'}
											return OrderedDict(
											    [
											        ('input_ids', dynamic_axis),
											        ('attention_mask', dynamic_axis),
											        ('token_type_ids', dynamic_axis),
											    ]       )












'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_torch_available,
    is_vision_available,
)


A   : Optional[Any]             =			{'configuration_deit': ['DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DeiTConfig', 'DeiTOnnxConfig']}

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A   : str             =			['DeiTFeatureExtractor']
		A   : Optional[int]             =			['DeiTImageProcessor']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A   : Optional[Any]             =			[
		    'DEIT_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'DeiTForImageClassification',
		    'DeiTForImageClassificationWithTeacher',
		    'DeiTForMaskedImageModeling',
		    'DeiTModel',
		    'DeiTPreTrainedModel',
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A   : int             =			[
		    'TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TFDeiTForImageClassification',
		    'TFDeiTForImageClassificationWithTeacher',
		    'TFDeiTForMaskedImageModeling',
		    'TFDeiTModel',
		    'TFDeiTPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_deit import DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, DeiTConfig, DeiTOnnxConfig

		try:
				if not is_vision_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_deit import DeiTFeatureExtractor
				from .image_processing_deit import DeiTImageProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_deit import (
				    DEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    DeiTForImageClassification,
				    DeiTForImageClassificationWithTeacher,
				    DeiTForMaskedImageModeling,
				    DeiTModel,
				    DeiTPreTrainedModel,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_deit import (
				    TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFDeiTForImageClassification,
				    TFDeiTForImageClassificationWithTeacher,
				    TFDeiTForMaskedImageModeling,
				    TFDeiTModel,
				    TFDeiTPreTrainedModel,
				)


else:
		import sys

		A   : Union[str, Any]             =			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





