





from collections import OrderedDict
from typing import Mapping

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


snake_case__					:							Optional[Any]													=     logging.get_logger(__name__)

snake_case__					:							Dict													=     {
    '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 A_					(			UpperCamelCase__   ):
   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	:Optional[Any]    ,   _UpperCamelCase	:List[Any]=3_0145    ,   _UpperCamelCase	:Optional[Any]=2048    ,   _UpperCamelCase	:Any=12    ,   _UpperCamelCase	:int=16    ,   _UpperCamelCase	:Optional[int]=0.1    ,   _UpperCamelCase	:Union[str, Any]=0.1    ,   _UpperCamelCase	:Dict=True    ,   _UpperCamelCase	:Optional[int]=False    ,   _UpperCamelCase	:Optional[int]=False    ,   _UpperCamelCase	:int=False    ,   _UpperCamelCase	:Union[str, Any]=1    ,   _UpperCamelCase	:List[Any]=True    ,   _UpperCamelCase	:Dict=512    ,   _UpperCamelCase	:List[Any]=2048**-0.5    ,   _UpperCamelCase	:str=1e-12    ,   _UpperCamelCase	:List[str]=0.0_2    ,   _UpperCamelCase	:Optional[Any]=0    ,   _UpperCamelCase	:int=1    ,   _UpperCamelCase	:Union[str, Any]=2    ,   _UpperCamelCase	:Tuple=3    ,   _UpperCamelCase	:Union[str, Any]=5    ,   _UpperCamelCase	:Union[str, Any]=True    ,   _UpperCamelCase	:List[Any]="first"    ,   _UpperCamelCase	:str=True    ,   _UpperCamelCase	:Dict=None    ,   _UpperCamelCase	:int=True    ,   _UpperCamelCase	:Dict=0.1    ,   _UpperCamelCase	:int=5    ,   _UpperCamelCase	:Union[str, Any]=5    ,   _UpperCamelCase	:Any=0    ,   _UpperCamelCase	:Optional[int]=0    ,   _UpperCamelCase	:Optional[Any]=2    ,   _UpperCamelCase	:Dict=0    ,   **_UpperCamelCase	:Union[str, Any]    ,   )->					Optional[int]:
         __A          =				vocab_size
         __A          =				emb_dim
         __A          =				n_layers
         __A          =				n_heads
         __A          =				dropout
         __A          =				attention_dropout
         __A          =				gelu_activation
         __A          =				sinusoidal_embeddings
         __A          =				causal
         __A          =				asm
         __A          =				n_langs
         __A          =				use_lang_emb
         __A          =				layer_norm_eps
         __A          =				bos_index
         __A          =				eos_index
         __A          =				pad_index
         __A          =				unk_index
         __A          =				mask_index
         __A          =				is_encoder
         __A          =				max_position_embeddings
         __A          =				embed_init_std
         __A          =				init_std
         __A          =				summary_type
         __A          =				summary_use_proj
         __A          =				summary_activation
         __A          =				summary_proj_to_labels
         __A          =				summary_first_dropout
         __A          =				start_n_top
         __A          =				end_n_top
         __A          =				mask_token_id
         __A          =				lang_id

         if "n_words" in kwargs:
               __A          =				kwargs["""n_words"""]

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





class A_					(			UpperCamelCase__   ):




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











def 				lowerCAmelCase_	(     snake_case_     ):
      if number < 0:
            raise ValueError("""number must not be negative"""     )
      return number & (number - 1) == 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()

