

from collections import OrderedDict
from typing import Mapping

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


_lowerCAmelCase  :      Dict			 =logging.get_logger(__name__)

_lowerCAmelCase  :      List[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 __UpperCamelCase     (				_a		):






					'''simple docstring'''



					__magic_name__        =   "xlm"
					__magic_name__        =   {
					    "hidden_size": "emb_dim",
					    "num_attention_heads": "n_heads",
					    "num_hidden_layers": "n_layers",
					    "n_words": "vocab_size",  # For backward compatibility
					}





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

						if "n_words" in kwargs:
							UpperCAmelCase__:	Tuple									= kwargs["n_words"]

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

class __UpperCamelCase     (				_a		):






					'''simple docstring'''



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


def 			_A	(      SCREAMING_SNAKE_CASE      ):
	UpperCAmelCase__:	Tuple									= int(SCREAMING_SNAKE_CASE      )
	if decimal in (0, 1):  # Exit cases for the recursion
		return str(SCREAMING_SNAKE_CASE      )
	UpperCAmelCase__							,						UpperCAmelCase__:	Union[str, Any]									= divmod(SCREAMING_SNAKE_CASE	,2      )
	return binary_recursive(SCREAMING_SNAKE_CASE      ) + str(SCREAMING_SNAKE_CASE      )



def 			_A	(      SCREAMING_SNAKE_CASE      ):
	UpperCAmelCase__:	List[str]									= str(SCREAMING_SNAKE_CASE      ).strip()
	if not number:
		raise ValueError("No input value was provided"      )
	UpperCAmelCase__:	Tuple									= "-" if number.startswith("-"      ) else ""
	UpperCAmelCase__:	Any									= number.lstrip("-"      )
	if not number.isnumeric():
		raise ValueError("Input value is not an integer"      )
	return f"{negative}0b{binary_recursive(int(SCREAMING_SNAKE_CASE      )      )}"


if __name__ == "__main__":
					from doctest import testmod

					testmod()