





"""simple docstring"""
from collections import OrderedDict
from typing import Mapping

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


lowerCamelCase_          =	logging.get_logger(__name__)

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






class       _SCREAMING_SNAKE_CASE(     snake_case__						):
       SCREAMING_SNAKE_CASE_     :   Tuple					=						'''mega'''




       def __init__(		self	,SCREAMING_SNAKE_CASE__=3_05_22	,SCREAMING_SNAKE_CASE__=1_28	,SCREAMING_SNAKE_CASE__=4	,SCREAMING_SNAKE_CASE__=2_56	,SCREAMING_SNAKE_CASE__=16	,SCREAMING_SNAKE_CASE__=True	,SCREAMING_SNAKE_CASE__=64	,SCREAMING_SNAKE_CASE__=False	,SCREAMING_SNAKE_CASE__=-1	,SCREAMING_SNAKE_CASE__=None	,SCREAMING_SNAKE_CASE__=True	,SCREAMING_SNAKE_CASE__="scalenorm"	,SCREAMING_SNAKE_CASE__=True	,SCREAMING_SNAKE_CASE__="silu"	,SCREAMING_SNAKE_CASE__="softmax"	,SCREAMING_SNAKE_CASE__=0.1	,SCREAMING_SNAKE_CASE__=0.1	,SCREAMING_SNAKE_CASE__=0.1	,SCREAMING_SNAKE_CASE__=False	,SCREAMING_SNAKE_CASE__=True	,SCREAMING_SNAKE_CASE__=2_56	,SCREAMING_SNAKE_CASE__=True	,SCREAMING_SNAKE_CASE__=0.1	,SCREAMING_SNAKE_CASE__=20_48	,SCREAMING_SNAKE_CASE__=False	,SCREAMING_SNAKE_CASE__=2	,SCREAMING_SNAKE_CASE__=0.0_2	,SCREAMING_SNAKE_CASE__=0.2	,SCREAMING_SNAKE_CASE__=0.0_2	,SCREAMING_SNAKE_CASE__=1.0	,SCREAMING_SNAKE_CASE__=1	,SCREAMING_SNAKE_CASE__=0	,SCREAMING_SNAKE_CASE__=2	,SCREAMING_SNAKE_CASE__="rotary"	,SCREAMING_SNAKE_CASE__=None	,SCREAMING_SNAKE_CASE__=True	,SCREAMING_SNAKE_CASE__=True	,**SCREAMING_SNAKE_CASE__	,)    ->   List[Any]:





             """simple docstring"""






             super().__init__(pad_token_id=__snake_case	,bos_token_id=__snake_case	,eos_token_id=__snake_case	,**__snake_case							)

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






class       _SCREAMING_SNAKE_CASE(     snake_case__						):




       @property
       def 					_UpperCamelCase  (		self							)    ->   Any:





             """simple docstring"""






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






"""simple docstring"""
def   __lowerCamelCase     (							a_  :	str							)    ->   int:
      __SCREAMING_SNAKE_CASE     :List[Any]	       =						0
      for plain_chr in plain_text:
            __SCREAMING_SNAKE_CASE     :List[str]	       =						(
                ord(a_							) + (hash_value << 6) + (hash_value << 16) - hash_value
            )
      return hash_value