





'''simple docstring'''




from collections import OrderedDict
from typing import Mapping

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


lowercase__       : Union[str, Any]         =       logging.get_logger(__name__)

lowercase__       : Optional[int]         =       {
    '''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 					SCREAMING_SNAKE_CASE       (a__				):
     lowerCAmelCase						     =			'''xlm'''
     lowerCAmelCase						     =			{
         '''hidden_size''': '''emb_dim''',
         '''num_attention_heads''': '''n_heads''',
         '''num_hidden_layers''': '''n_layers''',
         '''n_words''': '''vocab_size''',  # For backward compatibility
     }


     def __init__(		self		,      _UpperCAmelCase=3_0145		,      _UpperCAmelCase=2048		,      _UpperCAmelCase=12		,      _UpperCAmelCase=16		,      _UpperCAmelCase=0.1		,      _UpperCAmelCase=0.1		,      _UpperCAmelCase=True		,      _UpperCAmelCase=False		,      _UpperCAmelCase=False		,      _UpperCAmelCase=False		,      _UpperCAmelCase=1		,      _UpperCAmelCase=True		,      _UpperCAmelCase=512		,      _UpperCAmelCase=2048**-0.5		,      _UpperCAmelCase=1e-1_2		,      _UpperCAmelCase=0.02		,      _UpperCAmelCase=0		,      _UpperCAmelCase=1		,      _UpperCAmelCase=2		,      _UpperCAmelCase=3		,      _UpperCAmelCase=5		,      _UpperCAmelCase=True		,      _UpperCAmelCase="first"		,      _UpperCAmelCase=True		,      _UpperCAmelCase=None		,      _UpperCAmelCase=True		,      _UpperCAmelCase=0.1		,      _UpperCAmelCase=5		,      _UpperCAmelCase=5		,      _UpperCAmelCase=0		,      _UpperCAmelCase=0		,      _UpperCAmelCase=2		,      _UpperCAmelCase=0		,      **_UpperCAmelCase		,      ):

          '''simple docstring'''






          __A		:					int						=			vocab_size
          __A		:					Optional[int]						=			emb_dim
          __A		:					Any						=			n_layers
          __A		:					Optional[Any]						=			n_heads
          __A		:					Optional[Any]						=			dropout
          __A		:					Optional[int]						=			attention_dropout
          __A		:					List[str]						=			gelu_activation
          __A		:					Any						=			sinusoidal_embeddings
          __A		:					List[Any]						=			causal
          __A		:					Any						=			asm
          __A		:					int						=			n_langs
          __A		:					List[Any]						=			use_lang_emb
          __A		:					Tuple						=			layer_norm_eps
          __A		:					Any						=			bos_index
          __A		:					Any						=			eos_index
          __A		:					Optional[Any]						=			pad_index
          __A		:					int						=			unk_index
          __A		:					List[Any]						=			mask_index
          __A		:					List[str]						=			is_encoder
          __A		:					Dict						=			max_position_embeddings
          __A		:					Any						=			embed_init_std
          __A		:					Tuple						=			init_std
          __A		:					Any						=			summary_type
          __A		:					Dict						=			summary_use_proj
          __A		:					Dict						=			summary_activation
          __A		:					Dict						=			summary_proj_to_labels
          __A		:					List[Any]						=			summary_first_dropout
          __A		:					str						=			start_n_top
          __A		:					Any						=			end_n_top
          __A		:					Tuple						=			mask_token_id
          __A		:					Tuple						=			lang_id

          if "n_words" in kwargs:
               __A		:					Dict						=			kwargs['n_words']

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




class 					SCREAMING_SNAKE_CASE       (a__				):


     @property
     def 				SCREAMING_SNAKE_CASE    (		self):

          '''simple docstring'''






          if self.task == "multiple-choice":
               __A		:					List[Any]						=			{0: 'batch', 1: 'choice', 2: 'sequence'}
          else:
               __A		:					List[str]						=			{0: 'batch', 1: 'sequence'}
          return OrderedDict(
              [
                  ('input_ids', dynamic_axis),
                  ('attention_mask', dynamic_axis),
                  ('token_type_ids', dynamic_axis),
              ])





'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCAmelCase_					=   {
    "configuration_deberta": ["DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DebertaConfig", "DebertaOnnxConfig"],
    "tokenization_deberta": ["DebertaTokenizer"],
}

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_					=   ["DebertaTokenizerFast"]

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_					=   [
      "DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST",
      "DebertaForMaskedLM",
      "DebertaForQuestionAnswering",
      "DebertaForSequenceClassification",
      "DebertaForTokenClassification",
      "DebertaModel",
      "DebertaPreTrainedModel",
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_					=   [
      "TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST",
      "TFDebertaForMaskedLM",
      "TFDebertaForQuestionAnswering",
      "TFDebertaForSequenceClassification",
      "TFDebertaForTokenClassification",
      "TFDebertaModel",
      "TFDebertaPreTrainedModel",
  ]


if TYPE_CHECKING:
  from .configuration_deberta import DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaConfig, DebertaOnnxConfig
  from .tokenization_deberta import DebertaTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_deberta_fast import DebertaTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_deberta import (
        DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
        DebertaForMaskedLM,
        DebertaForQuestionAnswering,
        DebertaForSequenceClassification,
        DebertaForTokenClassification,
        DebertaModel,
        DebertaPreTrainedModel,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_deberta import (
        TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFDebertaForMaskedLM,
        TFDebertaForQuestionAnswering,
        TFDebertaForSequenceClassification,
        TFDebertaForTokenClassification,
        TFDebertaModel,
        TFDebertaPreTrainedModel,
    )


else:
  import sys

  UpperCAmelCase_					=   _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)



