



from collections import OrderedDict
from typing import Mapping

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


__UpperCAmelCase    	=  logging.get_logger(__name__)

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


class 						lowerCamelCase__			(		_UpperCAmelCase ):
						_lowerCAmelCase             =			"mega"


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

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


class 						lowerCamelCase__			(		_UpperCAmelCase ):


						@property
						def 	_lowerCamelCase      (			self    :	int      ):





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









from ..utils import DummyObject, requires_backends

class      __snake_case				(   metaclass=_UpperCAmelCase):
					SCREAMING_SNAKE_CASE_		:       str								=			["torch", "transformers", "k_diffusion"]
					def __init__(						self       :						Tuple	,      *_lowerCAmelCase       :						Union[str, Any]	,      **_lowerCAmelCase       :						Union[str, Any]  )							->					Dict:



											'''simple docstring'''





											requires_backends(self	,      ['torch', 'transformers', 'k_diffusion']  )
					@classmethod
					def 	a			(						cls       :						Optional[int]	,      *_lowerCAmelCase       :						Any	,      **_lowerCAmelCase       :						Optional[Any]  )							->					Optional[Any]:



											'''simple docstring'''





											requires_backends(cls	,      ['torch', 'transformers', 'k_diffusion']  )







					@classmethod
					def 	a			(						cls       :						Union[str, Any]	,      *_lowerCAmelCase       :						Tuple	,      **_lowerCAmelCase       :						str  )							->					Tuple:



											'''simple docstring'''





											requires_backends(cls	,      ['torch', 'transformers', 'k_diffusion']  )

