





'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available


a__					:			str          =     {'''tokenization_herbert''': ['''HerbertTokenizer''']}

try:
			if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			a__					:			Tuple          =     ['''HerbertTokenizerFast''']


if TYPE_CHECKING:
			from .tokenization_herbert import HerbertTokenizer

			try:
						if not is_tokenizers_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .tokenization_herbert_fast import HerbertTokenizerFast

else:
			import sys

			a__					:			Optional[Any]          =     _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)










'''simple docstring'''




from collections import OrderedDict
from typing import Mapping

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


a__					:			str          =     logging.get_logger(__name__)

a__					:			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 				__snake_case     (					__magic_name__							):
	__lowerCAmelCase       						=  '''xlm'''
	__lowerCAmelCase       						=  {
	    '''hidden_size''': '''emb_dim''',
	    '''num_attention_heads''': '''n_heads''',
	    '''num_hidden_layers''': '''n_layers''',
	    '''n_words''': '''vocab_size''',  # For backward compatibility
	}





	def __init__(		self      ,       UpperCamelCase_=3_0145      ,       UpperCamelCase_=2048      ,       UpperCamelCase_=12      ,       UpperCamelCase_=16      ,       UpperCamelCase_=0.1      ,       UpperCamelCase_=0.1      ,       UpperCamelCase_=True      ,       UpperCamelCase_=False      ,       UpperCamelCase_=False      ,       UpperCamelCase_=False      ,       UpperCamelCase_=1      ,       UpperCamelCase_=True      ,       UpperCamelCase_=512      ,       UpperCamelCase_=2048**-0.5      ,       UpperCamelCase_=1E-1_2      ,       UpperCamelCase_=0.0_2      ,       UpperCamelCase_=0      ,       UpperCamelCase_=1      ,       UpperCamelCase_=2      ,       UpperCamelCase_=3      ,       UpperCamelCase_=5      ,       UpperCamelCase_=True      ,       UpperCamelCase_="first"      ,       UpperCamelCase_=True      ,       UpperCamelCase_=None      ,       UpperCamelCase_=True      ,       UpperCamelCase_=0.1      ,       UpperCamelCase_=5      ,       UpperCamelCase_=5      ,       UpperCamelCase_=0      ,       UpperCamelCase_=0      ,       UpperCamelCase_=2      ,       UpperCamelCase_=0      ,       **UpperCamelCase_      ,       )      ->		List[str]:
		snake_case__	       =   vocab_size
		snake_case__	       =   emb_dim
		snake_case__	       =   n_layers
		snake_case__	       =   n_heads
		snake_case__	       =   dropout
		snake_case__	       =   attention_dropout
		snake_case__	       =   gelu_activation
		snake_case__	       =   sinusoidal_embeddings
		snake_case__	       =   causal
		snake_case__	       =   asm
		snake_case__	       =   n_langs
		snake_case__	       =   use_lang_emb
		snake_case__	       =   layer_norm_eps
		snake_case__	       =   bos_index
		snake_case__	       =   eos_index
		snake_case__	       =   pad_index
		snake_case__	       =   unk_index
		snake_case__	       =   mask_index
		snake_case__	       =   is_encoder
		snake_case__	       =   max_position_embeddings
		snake_case__	       =   embed_init_std
		snake_case__	       =   init_std
		snake_case__	       =   summary_type
		snake_case__	       =   summary_use_proj
		snake_case__	       =   summary_activation
		snake_case__	       =   summary_proj_to_labels
		snake_case__	       =   summary_first_dropout
		snake_case__	       =   start_n_top
		snake_case__	       =   end_n_top
		snake_case__	       =   mask_token_id
		snake_case__	       =   lang_id

		if "n_words" in kwargs:
			snake_case__	       =   kwargs['n_words']

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






class 				__snake_case     (					__magic_name__							):





	@property
	def   _snake_case   (		self		)      ->		Mapping[str, Mapping[int, str]]:
		if self.task == "multiple-choice":
			snake_case__	       =   {0: 'batch', 1: 'choice', 2: 'sequence'}
		else:
			snake_case__	       =   {0: 'batch', 1: 'sequence'}
		return OrderedDict(
		    [
		        ('input_ids', dynamic_axis),
		        ('attention_mask', dynamic_axis),
		        ('token_type_ids', dynamic_axis),
		    ]		)



