



from collections import OrderedDict
from typing import Mapping

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


UpperCAmelCase__			:   str      			=    logging.get_logger(__name__)

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





class 							lowerCAmelCase_		(		lowercase_     ):
		SCREAMING_SNAKE_CASE_       :			Optional[Any]					       =	"mega"







		def __init__(    self  :   Any       ,		UpperCAmelCase_  :   List[Any]=30522       ,		UpperCAmelCase_  :   List[str]=128       ,		UpperCAmelCase_  :   Any=4       ,		UpperCAmelCase_  :   List[Any]=256       ,		UpperCAmelCase_  :   List[str]=16       ,		UpperCAmelCase_  :   Optional[Any]=True       ,		UpperCAmelCase_  :   Dict=64       ,		UpperCAmelCase_  :   List[str]=False       ,		UpperCAmelCase_  :   Optional[int]=-1       ,		UpperCAmelCase_  :   Optional[Any]=None       ,		UpperCAmelCase_  :   List[str]=True       ,		UpperCAmelCase_  :   Optional[Any]="scalenorm"       ,		UpperCAmelCase_  :   Any=True       ,		UpperCAmelCase_  :   List[Any]="silu"       ,		UpperCAmelCase_  :   int="softmax"       ,		UpperCAmelCase_  :   Union[str, Any]=0.1       ,		UpperCAmelCase_  :   Dict=0.1       ,		UpperCAmelCase_  :   List[Any]=0.1       ,		UpperCAmelCase_  :   List[str]=False       ,		UpperCAmelCase_  :   Optional[Any]=True       ,		UpperCAmelCase_  :   List[str]=256       ,		UpperCAmelCase_  :   Any=True       ,		UpperCAmelCase_  :   int=0.1       ,		UpperCAmelCase_  :   Optional[int]=2048       ,		UpperCAmelCase_  :   Union[str, Any]=False       ,		UpperCAmelCase_  :   Union[str, Any]=2       ,		UpperCAmelCase_  :   int=0.02       ,		UpperCAmelCase_  :   List[Any]=0.2       ,		UpperCAmelCase_  :   int=0.02       ,		UpperCAmelCase_  :   Optional[Any]=1.0       ,		UpperCAmelCase_  :   Tuple=1       ,		UpperCAmelCase_  :   List[str]=0       ,		UpperCAmelCase_  :   Union[str, Any]=2       ,		UpperCAmelCase_  :   List[Any]="rotary"       ,		UpperCAmelCase_  :   Optional[Any]=None       ,		UpperCAmelCase_  :   Tuple=True       ,		UpperCAmelCase_  :   Optional[Any]=True       ,		**UpperCAmelCase_  :   Optional[Any]       ,		)       ->		Optional[int]:


						'''simple docstring'''







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

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





class 							lowerCAmelCase_		(		lowercase_     ):







		@property
		def 					a_  (    self  :   int					)       ->		int:


						'''simple docstring'''







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





"""simple docstring"""







from typing import TYPE_CHECKING

from ...utils import _LazyModule


UpperCAmelCase:  Union[str, Any]			     =				{"""tokenization_phobert""": ["""PhobertTokenizer"""]}


if TYPE_CHECKING:
		from .tokenization_phobert import PhobertTokenizer

else:
		import sys

		UpperCAmelCase:  Optional[int]			     =				_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



