





'''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 		lowerCamelCase  (      _A       ):
	snake_case_      =   "xlm"
	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		,      a_=30_145		,      a_=2_048		,      a_=12		,      a_=16		,      a_=0.1		,      a_=0.1		,      a_=True		,      a_=False		,      a_=False		,      a_=False		,      a_=1		,      a_=True		,      a_=512		,      a_=2_048**-0.5		,      a_=1e-1_2		,      a_=0.02		,      a_=0		,      a_=1		,      a_=2		,      a_=3		,      a_=5		,      a_=True		,      a_="first"		,      a_=True		,      a_=None		,      a_=True		,      a_=0.1		,      a_=5		,      a_=5		,      a_=0		,      a_=0		,      a_=2		,      a_=0		,      **a_		,      ):
			lowerCAmelCase     :    str						=   vocab_size
			lowerCAmelCase     :    Optional[int]						=   emb_dim
			lowerCAmelCase     :    Optional[int]						=   n_layers
			lowerCAmelCase     :    Any						=   n_heads
			lowerCAmelCase     :    int						=   dropout
			lowerCAmelCase     :    Any						=   attention_dropout
			lowerCAmelCase     :    Optional[Any]						=   gelu_activation
			lowerCAmelCase     :    Optional[int]						=   sinusoidal_embeddings
			lowerCAmelCase     :    str						=   causal
			lowerCAmelCase     :    List[Any]						=   asm
			lowerCAmelCase     :    Union[str, Any]						=   n_langs
			lowerCAmelCase     :    Dict						=   use_lang_emb
			lowerCAmelCase     :    int						=   layer_norm_eps
			lowerCAmelCase     :    int						=   bos_index
			lowerCAmelCase     :    int						=   eos_index
			lowerCAmelCase     :    Dict						=   pad_index
			lowerCAmelCase     :    List[Any]						=   unk_index
			lowerCAmelCase     :    Union[str, Any]						=   mask_index
			lowerCAmelCase     :    int						=   is_encoder
			lowerCAmelCase     :    str						=   max_position_embeddings
			lowerCAmelCase     :    Any						=   embed_init_std
			lowerCAmelCase     :    str						=   init_std
			lowerCAmelCase     :    int						=   summary_type
			lowerCAmelCase     :    Tuple						=   summary_use_proj
			lowerCAmelCase     :    List[Any]						=   summary_activation
			lowerCAmelCase     :    List[str]						=   summary_proj_to_labels
			lowerCAmelCase     :    Dict						=   summary_first_dropout
			lowerCAmelCase     :    List[str]						=   start_n_top
			lowerCAmelCase     :    List[str]						=   end_n_top
			lowerCAmelCase     :    List[str]						=   mask_token_id
			lowerCAmelCase     :    List[str]						=   lang_id

			if "n_words" in kwargs:
					lowerCAmelCase     :    Dict						=   kwargs["n_words"]

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






class 		lowerCamelCase  (      _A       ):



	@property
	def   _lowerCamelCase    (   self	):
			if self.task == "multiple-choice":
					lowerCAmelCase     :    List[str]						=   {0: "batch", 1: "choice", 2: "sequence"}
			else:
					lowerCAmelCase     :    Tuple						=   {0: "batch", 1: "sequence"}
			return OrderedDict(
			    [
			        ("input_ids", dynamic_axis),
			        ("attention_mask", dynamic_axis),
			        ("token_type_ids", dynamic_axis),
			    ]	)










'''simple docstring'''






import numpy as np






def      __A						(							a_						:  np.array	):
		return 1 / (1 + np.exp(-vector	))


if __name__ == "__main__":
					import doctest

					doctest.testmod()



