

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'''

			SCREAMING_SNAKE_CASE  :     Union[str, Any]		    =       "mega"







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

									snake_case_     =			vocab_size
									snake_case_     =			hidden_size
									snake_case_     =			num_hidden_layers
									snake_case_     =			activation
									snake_case_     =			attention_activation
									snake_case_     =			intermediate_size
									snake_case_     =			ema_projection_size
									snake_case_     =			bidirectional
									snake_case_     =			shared_representation_size
									snake_case_     =			use_chunking
									snake_case_     =			chunk_size
									snake_case_     =			truncation
									snake_case_     =			normalize_before_mega
									snake_case_     =			normalization_type
									snake_case_     =			norm_affine
									snake_case_     =			dropout_prob
									snake_case_     =			hidden_dropout_prob
									snake_case_     =			attention_probs_dropout_prob
									snake_case_     =			use_feature_dropout
									snake_case_     =			use_normalized_ffn
									snake_case_     =			nffn_hidden_size
									snake_case_     =			normalize_before_ffn
									snake_case_     =			nffn_activation_dropout_prob
									snake_case_     =			max_positions
									snake_case_     =			add_token_type_embeddings
									snake_case_     =			type_vocab_size
									snake_case_     =			initializer_range
									snake_case_     =			ema_delta_alpha_range
									snake_case_     =			ema_beta_range
									snake_case_     =			ema_gamma_omega_range
									snake_case_     =			relative_positional_bias
									snake_case_     =			use_cache
									snake_case_     =			classifier_dropout
									snake_case_     =			add_lm_hidden_dense_layer
									snake_case_     =			1  # not used but required by Hugging Face






class 			snake_case_     (	__A      ):







			'''simple docstring'''

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


import warnings

from .generation import GenerationMixin





class 			snake_case_     (	__A      ):







			'''simple docstring'''

			warnings.warn(
			    "Importing `GenerationMixin` from `src/transformers/generation_utils.py` is deprecated and will "
			    "be removed in Transformers v5. Import as `from transformers import GenerationMixin` instead."			, __A			, )