

'''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 						__magic_name__    (       lowercase_    ):
 UpperCAmelCase							    =						'''xlm'''
 UpperCAmelCase							    =						{
     '''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]			,						lowerCAmelCase__		: Optional[int]=3_0_1_4_5			,						lowerCAmelCase__		: List[str]=2_0_4_8			,						lowerCAmelCase__		: List[str]=1_2			,						lowerCAmelCase__		: List[Any]=1_6			,						lowerCAmelCase__		: Optional[int]=0.1			,						lowerCAmelCase__		: Optional[int]=0.1			,						lowerCAmelCase__		: List[str]=True			,						lowerCAmelCase__		: Optional[Any]=False			,						lowerCAmelCase__		: List[Any]=False			,						lowerCAmelCase__		: str=False			,						lowerCAmelCase__		: Tuple=1			,						lowerCAmelCase__		: Tuple=True			,						lowerCAmelCase__		: Any=5_1_2			,						lowerCAmelCase__		: List[str]=2_0_4_8**-0.5			,						lowerCAmelCase__		: str=1e-1_2			,						lowerCAmelCase__		: Dict=0.02			,						lowerCAmelCase__		: Any=0			,						lowerCAmelCase__		: Optional[Any]=1			,						lowerCAmelCase__		: Optional[int]=2			,						lowerCAmelCase__		: Dict=3			,						lowerCAmelCase__		: int=5			,						lowerCAmelCase__		: Optional[Any]=True			,						lowerCAmelCase__		: Dict="first"			,						lowerCAmelCase__		: Union[str, Any]=True			,						lowerCAmelCase__		: List[str]=None			,						lowerCAmelCase__		: Tuple=True			,						lowerCAmelCase__		: List[str]=0.1			,						lowerCAmelCase__		: str=5			,						lowerCAmelCase__		: Optional[int]=5			,						lowerCAmelCase__		: Optional[int]=0			,						lowerCAmelCase__		: Optional[int]=0			,						lowerCAmelCase__		: Optional[Any]=2			,						lowerCAmelCase__		: List[str]=0			,						**lowerCAmelCase__		: int			,						)    ->      Tuple:
   UpperCAmelCase					      =  vocab_size
   UpperCAmelCase					      =  emb_dim
   UpperCAmelCase					      =  n_layers
   UpperCAmelCase					      =  n_heads
   UpperCAmelCase					      =  dropout
   UpperCAmelCase					      =  attention_dropout
   UpperCAmelCase					      =  gelu_activation
   UpperCAmelCase					      =  sinusoidal_embeddings
   UpperCAmelCase					      =  causal
   UpperCAmelCase					      =  asm
   UpperCAmelCase					      =  n_langs
   UpperCAmelCase					      =  use_lang_emb
   UpperCAmelCase					      =  layer_norm_eps
   UpperCAmelCase					      =  bos_index
   UpperCAmelCase					      =  eos_index
   UpperCAmelCase					      =  pad_index
   UpperCAmelCase					      =  unk_index
   UpperCAmelCase					      =  mask_index
   UpperCAmelCase					      =  is_encoder
   UpperCAmelCase					      =  max_position_embeddings
   UpperCAmelCase					      =  embed_init_std
   UpperCAmelCase					      =  init_std
   UpperCAmelCase					      =  summary_type
   UpperCAmelCase					      =  summary_use_proj
   UpperCAmelCase					      =  summary_activation
   UpperCAmelCase					      =  summary_proj_to_labels
   UpperCAmelCase					      =  summary_first_dropout
   UpperCAmelCase					      =  start_n_top
   UpperCAmelCase					      =  end_n_top
   UpperCAmelCase					      =  mask_token_id
   UpperCAmelCase					      =  lang_id

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

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






class 						__magic_name__    (       lowercase_    ):


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






lowerCAmelCase__       = "\n# Transformers 설치 방법\n! pip install transformers datasets\n# 마지막 릴리스 대신 소스에서 설치하려면, 위 명령을 주석으로 바꾸고 아래 명령을 해제하세요.\n# ! pip install git+https://github.com/huggingface/transformers.git\n"

lowerCAmelCase__       = [{"type": "code", "content": INSTALL_CONTENT}]
lowerCAmelCase__       = {
    "{processor_class}": "FakeProcessorClass",
    "{model_class}": "FakeModelClass",
    "{object_class}": "FakeObjectClass",
}



