



"""simple docstring"""







from collections import OrderedDict
from typing import Mapping

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


lowercase__						:							int        =      logging.get_logger(__name__)

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







class  UpperCamelCase__  (      lowercase_    ):




      """simple docstring"""




      _SCREAMING_SNAKE_CASE    							=	"""mega"""



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

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







class  UpperCamelCase__  (      lowercase_    ):




      """simple docstring"""




      @property
      def 	SCREAMING_SNAKE_CASE__					( self							: Optional[Any]			):
        if self.task == "multiple-choice":
          lowerCAmelCase_  :							Tuple								=					{0: 'batch', 1: 'choice', 2: 'sequence'}
        else:
          lowerCAmelCase_  :							Any								=					{0: 'batch', 1: 'sequence'}
        return OrderedDict(
            [
                ('input_ids', dynamic_axis),
                ('attention_mask', dynamic_axis),
            ]			)










"""simple docstring"""







import pytest

from datasets.utils.version import Version

@pytest.mark.parametrize(
    'other, expected_equality'       ,  [
        (Version('1.0.0'		), True),
        ('1.0.0', True),
        (Version('2.0.0'		), False),
        ('2.0.0', False),
        ('1', False),
        ('a', False),
        (1, False),
        (None, False),
    ]       ,  )
def 							UpperCamelCase_       (       lowerCAmelCase__ :							List[Any]       ,  lowerCAmelCase__ :							List[Any]		)		->  Tuple:

  """simple docstring"""




  lowerCAmelCase_  :							List[str]								=					Version('1.0.0'		)
  assert (version == other) is expected_equality
  assert (version != other) is not expected_equality
  assert (hash(lowerCAmelCase__		) == hash(lowerCAmelCase__		)) is expected_equality





