




from collections import OrderedDict
from typing import Mapping

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


UpperCamelCase__    			=			logging.get_logger(__name__)

UpperCamelCase__    			=			{
    "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__    (					snake_case__      ):
						_a							:    int					=    """xlm"""
						_a							:    Optional[Any]					=    {
						    """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=3_0_1_4_5		,			_A=2_0_4_8		,			_A=1_2		,			_A=1_6		,			_A=0.1		,			_A=0.1		,			_A=True		,			_A=False		,			_A=False		,			_A=False		,			_A=1		,			_A=True		,			_A=5_1_2		,			_A=2_0_4_8**-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		,			):




											"""simple docstring"""



											__lowerCAmelCase				   =       vocab_size
											__lowerCAmelCase				   =       emb_dim
											__lowerCAmelCase				   =       n_layers
											__lowerCAmelCase				   =       n_heads
											__lowerCAmelCase				   =       dropout
											__lowerCAmelCase				   =       attention_dropout
											__lowerCAmelCase				   =       gelu_activation
											__lowerCAmelCase				   =       sinusoidal_embeddings
											__lowerCAmelCase				   =       causal
											__lowerCAmelCase				   =       asm
											__lowerCAmelCase				   =       n_langs
											__lowerCAmelCase				   =       use_lang_emb
											__lowerCAmelCase				   =       layer_norm_eps
											__lowerCAmelCase				   =       bos_index
											__lowerCAmelCase				   =       eos_index
											__lowerCAmelCase				   =       pad_index
											__lowerCAmelCase				   =       unk_index
											__lowerCAmelCase				   =       mask_index
											__lowerCAmelCase				   =       is_encoder
											__lowerCAmelCase				   =       max_position_embeddings
											__lowerCAmelCase				   =       embed_init_std
											__lowerCAmelCase				   =       init_std
											__lowerCAmelCase				   =       summary_type
											__lowerCAmelCase				   =       summary_use_proj
											__lowerCAmelCase				   =       summary_activation
											__lowerCAmelCase				   =       summary_proj_to_labels
											__lowerCAmelCase				   =       summary_first_dropout
											__lowerCAmelCase				   =       start_n_top
											__lowerCAmelCase				   =       end_n_top
											__lowerCAmelCase				   =       mask_token_id
											__lowerCAmelCase				   =       lang_id

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

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






class 			a__    (					snake_case__      ):






						@property
						def 				__SCREAMING_SNAKE_CASE(   self			):




											"""simple docstring"""



											if self.task == "multiple-choice":
																__lowerCAmelCase				   =       {0: "batch", 1: "choice", 2: "sequence"}
											else:
																__lowerCAmelCase				   =       {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_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowerCamelCase				:		Union[str, Any]     =   {
    "configuration_convbert": ["CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConvBertConfig", "ConvBertOnnxConfig"],
    "tokenization_convbert": ["ConvBertTokenizer"],
}

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase				:		Optional[Any]     =   ["ConvBertTokenizerFast"]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase				:		Dict     =   [
     "CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
     "ConvBertForMaskedLM",
     "ConvBertForMultipleChoice",
     "ConvBertForQuestionAnswering",
     "ConvBertForSequenceClassification",
     "ConvBertForTokenClassification",
     "ConvBertLayer",
     "ConvBertModel",
     "ConvBertPreTrainedModel",
     "load_tf_weights_in_convbert",
 ]


try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase				:		Tuple     =   [
     "TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
     "TFConvBertForMaskedLM",
     "TFConvBertForMultipleChoice",
     "TFConvBertForQuestionAnswering",
     "TFConvBertForSequenceClassification",
     "TFConvBertForTokenClassification",
     "TFConvBertLayer",
     "TFConvBertModel",
     "TFConvBertPreTrainedModel",
 ]


if TYPE_CHECKING:
 from .configuration_convbert import CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvBertConfig, ConvBertOnnxConfig
 from .tokenization_convbert import ConvBertTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_convbert_fast import ConvBertTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_convbert import (
      CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
      ConvBertForMaskedLM,
      ConvBertForMultipleChoice,
      ConvBertForQuestionAnswering,
      ConvBertForSequenceClassification,
      ConvBertForTokenClassification,
      ConvBertLayer,
      ConvBertModel,
      ConvBertPreTrainedModel,
      load_tf_weights_in_convbert,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_convbert import (
      TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFConvBertForMaskedLM,
      TFConvBertForMultipleChoice,
      TFConvBertForQuestionAnswering,
      TFConvBertForSequenceClassification,
      TFConvBertForTokenClassification,
      TFConvBertLayer,
      TFConvBertModel,
      TFConvBertPreTrainedModel,
  )


else:
 import sys

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



