

'''simple docstring'''






from collections import OrderedDict
from typing import Mapping

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


lowerCAmelCase__											=	logging.get_logger(__name__)

lowerCAmelCase__											=	{
    '''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 			lowercase_	(lowerCamelCase__      ):




  """simple docstring"""




  SCREAMING_SNAKE_CASE    :  List[Any]							=			'xlm'
  SCREAMING_SNAKE_CASE    :  str							=			{
      'hidden_size': 'emb_dim',
      'num_attention_heads': 'n_heads',
      'num_hidden_layers': 'n_layers',
      'n_words': 'vocab_size',  # For backward compatibility
  }






  def __init__(      self   :     Optional[Any]					,lowercase__   :     Optional[Any]=3_0_1_4_5					,lowercase__   :     Optional[int]=2_0_4_8					,lowercase__   :     Any=1_2					,lowercase__   :     Any=1_6					,lowercase__   :     Dict=0.1					,lowercase__   :     str=0.1					,lowercase__   :     Tuple=True					,lowercase__   :     Tuple=False					,lowercase__   :     Dict=False					,lowercase__   :     Dict=False					,lowercase__   :     Optional[int]=1					,lowercase__   :     Any=True					,lowercase__   :     Optional[int]=5_1_2					,lowercase__   :     Union[str, Any]=2_0_4_8**-0.5					,lowercase__   :     Any=1e-1_2					,lowercase__   :     Tuple=0.0_2					,lowercase__   :     Optional[int]=0					,lowercase__   :     Any=1					,lowercase__   :     str=2					,lowercase__   :     Optional[Any]=3					,lowercase__   :     Optional[int]=5					,lowercase__   :     List[Any]=True					,lowercase__   :     List[Any]="first"					,lowercase__   :     Union[str, Any]=True					,lowercase__   :     Optional[Any]=None					,lowercase__   :     int=True					,lowercase__   :     int=0.1					,lowercase__   :     Optional[Any]=5					,lowercase__   :     int=5					,lowercase__   :     List[str]=0					,lowercase__   :     List[str]=0					,lowercase__   :     Any=2					,lowercase__   :     List[str]=0					,**lowercase__   :     str					,):
   __lowercase							  = vocab_size
   __lowercase							  = emb_dim
   __lowercase							  = n_layers
   __lowercase							  = n_heads
   __lowercase							  = dropout
   __lowercase							  = attention_dropout
   __lowercase							  = gelu_activation
   __lowercase							  = sinusoidal_embeddings
   __lowercase							  = causal
   __lowercase							  = asm
   __lowercase							  = n_langs
   __lowercase							  = use_lang_emb
   __lowercase							  = layer_norm_eps
   __lowercase							  = bos_index
   __lowercase							  = eos_index
   __lowercase							  = pad_index
   __lowercase							  = unk_index
   __lowercase							  = mask_index
   __lowercase							  = is_encoder
   __lowercase							  = max_position_embeddings
   __lowercase							  = embed_init_std
   __lowercase							  = init_std
   __lowercase							  = summary_type
   __lowercase							  = summary_use_proj
   __lowercase							  = summary_activation
   __lowercase							  = summary_proj_to_labels
   __lowercase							  = summary_first_dropout
   __lowercase							  = start_n_top
   __lowercase							  = end_n_top
   __lowercase							  = mask_token_id
   __lowercase							  = lang_id

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

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






class 			lowercase_	(lowerCamelCase__      ):




  """simple docstring"""




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





"""simple docstring"""


A     :   int			    =			{
    "Pillow": "Pillow",
    "accelerate": "accelerate>=0.11.0",
    "compel": "compel==0.1.8",
    "black": "black~=23.1",
    "datasets": "datasets",
    "filelock": "filelock",
    "flax": "flax>=0.4.1",
    "hf-doc-builder": "hf-doc-builder>=0.3.0",
    "huggingface-hub": "huggingface-hub>=0.13.2",
    "requests-mock": "requests-mock==1.10.0",
    "importlib_metadata": "importlib_metadata",
    "invisible-watermark": "invisible-watermark",
    "isort": "isort>=5.5.4",
    "jax": "jax>=0.2.8,!=0.3.2",
    "jaxlib": "jaxlib>=0.1.65",
    "Jinja2": "Jinja2",
    "k-diffusion": "k-diffusion>=0.0.12",
    "torchsde": "torchsde",
    "note_seq": "note_seq",
    "librosa": "librosa",
    "numpy": "numpy",
    "omegaconf": "omegaconf",
    "parameterized": "parameterized",
    "protobuf": "protobuf>=3.20.3,<4",
    "pytest": "pytest",
    "pytest-timeout": "pytest-timeout",
    "pytest-xdist": "pytest-xdist",
    "ruff": "ruff>=0.0.241",
    "safetensors": "safetensors",
    "sentencepiece": "sentencepiece>=0.1.91,!=0.1.92",
    "scipy": "scipy",
    "onnx": "onnx",
    "regex": "regex!=2019.12.17",
    "requests": "requests",
    "tensorboard": "tensorboard",
    "torch": "torch>=1.4",
    "torchvision": "torchvision",
    "transformers": "transformers>=4.25.1",
    "urllib3": "urllib3<=2.0.0",
}




