





from collections import OrderedDict
from typing import Mapping

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


__lowercase							:str							=	logging.get_logger(__name__)

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



class  _a  (					lowercase__				):






							"""simple docstring"""

							snake_case_							=    "mega"

							def __init__(   self					:  List[Any]				,						a					:  List[str]=3_05_22				,						a					:  Optional[Any]=1_28				,						a					:  Optional[int]=4				,						a					:  str=2_56				,						a					:  Union[str, Any]=16				,						a					:  Any=True				,						a					:  int=64				,						a					:  Any=False				,						a					:  List[Any]=-1				,						a					:  Dict=None				,						a					:  Tuple=True				,						a					:  Optional[Any]="scalenorm"				,						a					:  Union[str, Any]=True				,						a					:  Union[str, Any]="silu"				,						a					:  List[str]="softmax"				,						a					:  List[str]=0.1				,						a					:  Union[str, Any]=0.1				,						a					:  Optional[Any]=0.1				,						a					:  List[Any]=False				,						a					:  int=True				,						a					:  Tuple=2_56				,						a					:  Optional[Any]=True				,						a					:  List[Any]=0.1				,						a					:  Optional[Any]=20_48				,						a					:  List[str]=False				,						a					:  Dict=2				,						a					:  int=0.02				,						a					:  Optional[int]=0.2				,						a					:  List[str]=0.02				,						a					:  List[Any]=1.0				,						a					:  str=1				,						a					:  List[str]=0				,						a					:  Optional[int]=2				,						a					:  Union[str, Any]="rotary"				,						a					:  str=None				,						a					:  List[str]=True				,						a					:  List[str]=True				,						**a					:  List[Any]				,						)						->Optional[int]:
													super().__init__(pad_token_id=a				,						bos_token_id=a				,						eos_token_id=a				,						**a     )

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







class  _a  (					lowercase__				):






							"""simple docstring"""

							@property
							def   A_	(   self					:  Union[str, Any]     )						->Mapping[str, Mapping[int, str]]:
													if self.task == "multiple-choice":
																			SCREAMING_SNAKE_CASE__  :					List[Any] =       {0: "batch", 1: "choice", 2: "sequence"}
													else:
																			SCREAMING_SNAKE_CASE__  :					Any =       {0: "batch", 1: "sequence"}
													return OrderedDict(
													    [
													        ("input_ids", dynamic_axis),
													        ("attention_mask", dynamic_axis),
													    ]     )






from __future__ import annotations

from enum import Enum, unique
from typing import TypeVar

# Create a generic variable that can be 'Enum', or any subclass.
__lowercase							:List[Any]							=	TypeVar("T", bound="Enum")



@unique
class  _a  (					lowercase__				):






							"""simple docstring"""

							snake_case_							=    80
							snake_case_							=    70
							snake_case_							=    60
							snake_case_							=    50
							snake_case_							=    40
							snake_case_							=    30
							snake_case_							=    20
							snake_case_							=    10







@unique
class  _a  (					lowercase__				):






							"""simple docstring"""

							snake_case_							=    24
							snake_case_							=    21
							snake_case_							=    18
							snake_case_							=    15
							snake_case_							=    12
							snake_case_							=    9
							snake_case_							=    6
							snake_case_							=    3
							snake_case_							=    2
							snake_case_							=    1
							snake_case_							=    -1
							snake_case_							=    -2
							snake_case_							=    -3
							snake_case_							=    -6
							snake_case_							=    -9
							snake_case_							=    -12
							snake_case_							=    -15
							snake_case_							=    -18
							snake_case_							=    -21
							snake_case_							=    -24

							@classmethod
							def   A_	(   cls					:  type[T]     )						->dict:
													return {unit.name: unit.value for unit in cls if unit.value > 0}






							@classmethod
							def   A_	(   cls					:  type[T]     )						->dict:
													return {unit.name: unit.value for unit in cls if unit.value < 0}







def    UpperCAmelCase				(  _lowerCamelCase   :	float  ):





						'''simple docstring'''


						SCREAMING_SNAKE_CASE__  :					str =       SIUnit.get_positive() if value > 0 else SIUnit.get_negative()
						for name_prefix, value_prefix in prefixes.items():
												SCREAMING_SNAKE_CASE__  :					str =       value / (10**value_prefix)
												if numerical_part > 1:
																		return f"""{numerical_part!s} {name_prefix}"""
						return str(_lowerCamelCase  )







def    UpperCAmelCase				(  _lowerCamelCase   :	float  ):





						'''simple docstring'''


						for prefix in BinaryUnit:
												SCREAMING_SNAKE_CASE__  :					List[Any] =       value / (2**prefix.value)
												if numerical_part > 1:
																		return f"""{numerical_part!s} {prefix.name}"""
						return str(_lowerCamelCase  )


if __name__ == "__main__":
				import doctest

				doctest.testmod()