




"""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  _snake_case				(							A__       ):

				'''simple docstring'''




				UpperCamelCase__		     ="""mega"""





				def __init__(							self      :  Optional[int]					,							snake_case      :  Union[str, Any]=30_522					,							snake_case      :  Optional[Any]=128					,							snake_case      :  str=4					,							snake_case      :  Dict=256					,							snake_case      :  Optional[Any]=16					,							snake_case      :  Any=True					,							snake_case      :  str=64					,							snake_case      :  Optional[Any]=False					,							snake_case      :  Union[str, Any]=-1					,							snake_case      :  List[str]=None					,							snake_case      :  Any=True					,							snake_case      :  Optional[int]="scalenorm"					,							snake_case      :  Tuple=True					,							snake_case      :  str="silu"					,							snake_case      :  Dict="softmax"					,							snake_case      :  Optional[int]=0.1					,							snake_case      :  Tuple=0.1					,							snake_case      :  Dict=0.1					,							snake_case      :  List[str]=False					,							snake_case      :  Any=True					,							snake_case      :  List[Any]=256					,							snake_case      :  Optional[Any]=True					,							snake_case      :  Optional[int]=0.1					,							snake_case      :  str=2_048					,							snake_case      :  Union[str, Any]=False					,							snake_case      :  List[Any]=2					,							snake_case      :  str=0.02					,							snake_case      :  str=0.2					,							snake_case      :  str=0.02					,							snake_case      :  Union[str, Any]=1.0					,							snake_case      :  Optional[Any]=1					,							snake_case      :  List[Any]=0					,							snake_case      :  List[Any]=2					,							snake_case      :  List[Any]="rotary"					,							snake_case      :  Tuple=None					,							snake_case      :  int=True					,							snake_case      :  Dict=True					,							**snake_case      :  List[str]					,							):
								super().__init__(pad_token_id=snake_case					,							bos_token_id=snake_case					,							eos_token_id=snake_case					,							**snake_case     )

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



class  _snake_case				(							A__       ):

				'''simple docstring'''




				@property
				def 				snake_case_ (							self      :  int     ):
								if self.task == "multiple-choice":
												UpperCAmelCase_					:List[str]      			=      {0: '''batch''', 1: '''choice''', 2: '''sequence'''}
								else:
												UpperCAmelCase_					:Tuple      			=      {0: '''batch''', 1: '''sequence'''}
								return OrderedDict(
								    [
								        ('''input_ids''', dynamic_axis),
								        ('''attention_mask''', dynamic_axis),
								    ]     )








"""simple docstring"""

def 				a (						__snake_case     :				int  ):



				'''simple docstring'''





				if not isinstance(__snake_case,    __snake_case  ) or number < 0:
								raise ValueError('''Input must be a non-negative integer'''  )

				UpperCAmelCase_					:Optional[Any]      			=      number & ~(number - 1)
				UpperCAmelCase_					:List[str]      			=      0
				while intermediate:
								intermediate >>= 1
								index += 1
				return index - 1


if __name__ == "__main__":
						import doctest

						doctest.testmod(verbose=True)


