



from collections import OrderedDict
from typing import Mapping

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


__lowerCamelCase     :							str											=				logging.get_logger(__name__)

__lowerCamelCase     :							Union[str, 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  __magic_name__   (							A__						):
		lowercase      :       Optional[int]          ='''xlm'''
		lowercase      :       int          ={
		    '''hidden_size''': '''emb_dim''',
		    '''num_attention_heads''': '''n_heads''',
		    '''num_hidden_layers''': '''n_layers''',
		    '''n_words''': '''vocab_size''',  # For backward compatibility
		}






		def __init__(						self      :     Dict				,		UpperCamelCase__      :     Tuple=3_01_45				,		UpperCamelCase__      :     Any=20_48				,		UpperCamelCase__      :     str=12				,		UpperCamelCase__      :     Any=16				,		UpperCamelCase__      :     str=0.1				,		UpperCamelCase__      :     int=0.1				,		UpperCamelCase__      :     Optional[Any]=True				,		UpperCamelCase__      :     Union[str, Any]=False				,		UpperCamelCase__      :     int=False				,		UpperCamelCase__      :     str=False				,		UpperCamelCase__      :     Tuple=1				,		UpperCamelCase__      :     Dict=True				,		UpperCamelCase__      :     Union[str, Any]=5_12				,		UpperCamelCase__      :     List[str]=20_48**-0.5				,		UpperCamelCase__      :     Any=1e-1_2				,		UpperCamelCase__      :     Optional[int]=0.02				,		UpperCamelCase__      :     Union[str, Any]=0				,		UpperCamelCase__      :     Dict=1				,		UpperCamelCase__      :     int=2				,		UpperCamelCase__      :     List[Any]=3				,		UpperCamelCase__      :     List[str]=5				,		UpperCamelCase__      :     str=True				,		UpperCamelCase__      :     int="first"				,		UpperCamelCase__      :     Any=True				,		UpperCamelCase__      :     Tuple=None				,		UpperCamelCase__      :     Optional[Any]=True				,		UpperCamelCase__      :     Optional[Any]=0.1				,		UpperCamelCase__      :     str=5				,		UpperCamelCase__      :     List[str]=5				,		UpperCamelCase__      :     Optional[int]=0				,		UpperCamelCase__      :     Union[str, Any]=0				,		UpperCamelCase__      :     List[str]=2				,		UpperCamelCase__      :     List[str]=0				,		**UpperCamelCase__      :     List[Any]				,		)				->					Any:
								'''simple docstring'''







								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=UpperCamelCase__				,		bos_token_id=UpperCamelCase__				,		**UpperCamelCase__      )





class  __magic_name__   (							A__						):






		@property
		def SCREAMING_SNAKE_CASE_			(						self      :     int      )				->					Mapping[str, Mapping[int, str]]:
								'''simple docstring'''







								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),
								    ]      )








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


__lowerCamelCase     :							Optional[int]  							=				{
    "configuration_roc_bert": ["ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RoCBertConfig"],
    "tokenization_roc_bert": ["RoCBertTokenizer"],
}

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		pass

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__lowerCamelCase     :							List[Any]  							=				[
		    "ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "RoCBertForCausalLM",
		    "RoCBertForMaskedLM",
		    "RoCBertForMultipleChoice",
		    "RoCBertForPreTraining",
		    "RoCBertForQuestionAnswering",
		    "RoCBertForSequenceClassification",
		    "RoCBertForTokenClassification",
		    "RoCBertLayer",
		    "RoCBertModel",
		    "RoCBertPreTrainedModel",
		    "load_tf_weights_in_roc_bert",
		]

if TYPE_CHECKING:
		from .configuration_roc_bert import ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RoCBertConfig
		from .tokenization_roc_bert import RoCBertTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				raise OptionalDependencyNotAvailable()

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_roc_bert import (
				    ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    RoCBertForCausalLM,
				    RoCBertForMaskedLM,
				    RoCBertForMultipleChoice,
				    RoCBertForPreTraining,
				    RoCBertForQuestionAnswering,
				    RoCBertForSequenceClassification,
				    RoCBertForTokenClassification,
				    RoCBertLayer,
				    RoCBertModel,
				    RoCBertPreTrainedModel,
				    load_tf_weights_in_roc_bert,
				)


else:
		import sys

		__lowerCamelCase     :							Optional[int]  							=				_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)



