



'''simple docstring'''





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__ (		snake_case__   ):
						_lowerCAmelCase								= '''mega'''


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

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


class 	lowerCamelCase__ (		snake_case__   ):


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










from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


__UpperCAmelCase						  =     {
    '''configuration_splinter''': ['''SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''SplinterConfig'''],
    '''tokenization_splinter''': ['''SplinterTokenizer'''],
}

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__UpperCAmelCase						  =     ['''SplinterTokenizerFast''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__UpperCAmelCase						  =     [
		    '''SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''SplinterForQuestionAnswering''',
		    '''SplinterForPreTraining''',
		    '''SplinterLayer''',
		    '''SplinterModel''',
		    '''SplinterPreTrainedModel''',
		]


if TYPE_CHECKING:
		from .configuration_splinter import SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP, SplinterConfig
		from .tokenization_splinter import SplinterTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_splinter_fast import SplinterTokenizerFast

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_splinter import (
				    SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    SplinterForPreTraining,
				    SplinterForQuestionAnswering,
				    SplinterLayer,
				    SplinterModel,
				    SplinterPreTrainedModel,
				)


else:
		import sys

		__UpperCAmelCase						  =     _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)





