






"""simple docstring"""



from collections import OrderedDict
from typing import Mapping

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


_lowerCAmelCase  :  Tuple   =			logging.get_logger(__name__)

_lowerCAmelCase  :  int   =			{
    """mnaylor/mega-base-wikitext""": """https://huggingface.co/mnaylor/mega-base-wikitext/resolve/main/config.json""",
}




class  lowerCAmelCase__ (						__magic_name__      ):
   SCREAMING_SNAKE_CASE_         ='''mega'''
   def __init__(		self			:  Dict       , snake_case__			:  Optional[int]=3_0_5_2_2       , snake_case__			:  Dict=1_2_8       , snake_case__			:  List[str]=4       , snake_case__			:  List[str]=2_5_6       , snake_case__			:  int=1_6       , snake_case__			:  Tuple=True       , snake_case__			:  int=6_4       , snake_case__			:  Optional[Any]=False       , snake_case__			:  Optional[Any]=-1       , snake_case__			:  int=None       , snake_case__			:  Any=True       , snake_case__			:  List[str]="scalenorm"       , snake_case__			:  int=True       , snake_case__			:  Optional[int]="silu"       , snake_case__			:  Optional[int]="softmax"       , snake_case__			:  Tuple=0.1       , snake_case__			:  Tuple=0.1       , snake_case__			:  int=0.1       , snake_case__			:  Optional[Any]=False       , snake_case__			:  List[str]=True       , snake_case__			:  Dict=2_5_6       , snake_case__			:  int=True       , snake_case__			:  int=0.1       , snake_case__			:  Optional[int]=2_0_4_8       , snake_case__			:  Any=False       , snake_case__			:  Any=2       , snake_case__			:  Dict=0.02       , snake_case__			:  List[Any]=0.2       , snake_case__			:  Any=0.02       , snake_case__			:  Union[str, Any]=1.0       , snake_case__			:  str=1       , snake_case__			:  Optional[int]=0       , snake_case__			:  Any=2       , snake_case__			:  List[Any]="rotary"       , snake_case__			:  Any=None       , snake_case__			:  Union[str, Any]=True       , snake_case__			:  Optional[Any]=True       , **snake_case__			:  int       , ):


        '''simple docstring'''
        super().__init__(pad_token_id=snake_case__       , bos_token_id=snake_case__       , eos_token_id=snake_case__       , **snake_case__       )

        UpperCAmelCase__	:						int       =       vocab_size
        UpperCAmelCase__	:						Optional[Any]       =       hidden_size
        UpperCAmelCase__	:						str       =       num_hidden_layers
        UpperCAmelCase__	:						List[str]       =       activation
        UpperCAmelCase__	:						str       =       attention_activation
        UpperCAmelCase__	:						str       =       intermediate_size
        UpperCAmelCase__	:						Dict       =       ema_projection_size
        UpperCAmelCase__	:						Optional[int]       =       bidirectional
        UpperCAmelCase__	:						Optional[int]       =       shared_representation_size
        UpperCAmelCase__	:						List[str]       =       use_chunking
        UpperCAmelCase__	:						Tuple       =       chunk_size
        UpperCAmelCase__	:						List[str]       =       truncation
        UpperCAmelCase__	:						Dict       =       normalize_before_mega
        UpperCAmelCase__	:						Union[str, Any]       =       normalization_type
        UpperCAmelCase__	:						str       =       norm_affine
        UpperCAmelCase__	:						Tuple       =       dropout_prob
        UpperCAmelCase__	:						List[Any]       =       hidden_dropout_prob
        UpperCAmelCase__	:						Dict       =       attention_probs_dropout_prob
        UpperCAmelCase__	:						List[Any]       =       use_feature_dropout
        UpperCAmelCase__	:						Optional[Any]       =       use_normalized_ffn
        UpperCAmelCase__	:						Optional[Any]       =       nffn_hidden_size
        UpperCAmelCase__	:						List[str]       =       normalize_before_ffn
        UpperCAmelCase__	:						List[str]       =       nffn_activation_dropout_prob
        UpperCAmelCase__	:						List[str]       =       max_positions
        UpperCAmelCase__	:						List[Any]       =       add_token_type_embeddings
        UpperCAmelCase__	:						Any       =       type_vocab_size
        UpperCAmelCase__	:						List[str]       =       initializer_range
        UpperCAmelCase__	:						Optional[Any]       =       ema_delta_alpha_range
        UpperCAmelCase__	:						Union[str, Any]       =       ema_beta_range
        UpperCAmelCase__	:						Optional[Any]       =       ema_gamma_omega_range
        UpperCAmelCase__	:						Optional[Any]       =       relative_positional_bias
        UpperCAmelCase__	:						Optional[Any]       =       use_cache
        UpperCAmelCase__	:						Optional[Any]       =       classifier_dropout
        UpperCAmelCase__	:						Tuple       =       add_lm_hidden_dense_layer
        UpperCAmelCase__	:						Any       =       1  # not used but required by Hugging Face




class  lowerCAmelCase__ (						__magic_name__      ):
   @property
   def 			__a       (		self			:  Optional[Any]       ):


        '''simple docstring'''
        if self.task == "multiple-choice":
             UpperCAmelCase__	:						Optional[Any]       =       {0: "batch", 1: "choice", 2: "sequence"}
        else:
             UpperCAmelCase__	:						Union[str, Any]       =       {0: "batch", 1: "sequence"}
        return OrderedDict(
            [
                ("input_ids", dynamic_axis),
                ("attention_mask", dynamic_axis),
            ]       )










"""simple docstring"""



from typing import TYPE_CHECKING

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


_lowerCAmelCase  :  List[Any]   =			{
    """configuration_markuplm""": ["""MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP""", """MarkupLMConfig"""],
    """feature_extraction_markuplm""": ["""MarkupLMFeatureExtractor"""],
    """processing_markuplm""": ["""MarkupLMProcessor"""],
    """tokenization_markuplm""": ["""MarkupLMTokenizer"""],
}

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _lowerCAmelCase  :  str   =			["""MarkupLMTokenizerFast"""]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _lowerCAmelCase  :  List[str]   =			[
     """MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """MarkupLMForQuestionAnswering""",
     """MarkupLMForSequenceClassification""",
     """MarkupLMForTokenClassification""",
     """MarkupLMModel""",
     """MarkupLMPreTrainedModel""",
 ]


if TYPE_CHECKING:
 from .configuration_markuplm import MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP, MarkupLMConfig
 from .feature_extraction_markuplm import MarkupLMFeatureExtractor
 from .processing_markuplm import MarkupLMProcessor
 from .tokenization_markuplm import MarkupLMTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_markuplm_fast import MarkupLMTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_markuplm import (
      MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST,
      MarkupLMForQuestionAnswering,
      MarkupLMForSequenceClassification,
      MarkupLMForTokenClassification,
      MarkupLMModel,
      MarkupLMPreTrainedModel,
  )


else:
 import sys

 _lowerCAmelCase  :  Dict   =			_LazyModule(__name__, globals()["""__file__"""], _import_structure)


