





"""simple docstring"""





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 							_lowerCamelCase   (							__lowerCamelCase			):
						UpperCAmelCase_			=      "mega"


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

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





class 							_lowerCamelCase   (							__lowerCamelCase			):


						@property
						def      snake_case_ (self		)			-> Any:






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







"""simple docstring"""







def   __lowerCAmelCase(		__UpperCAmelCase      ):






	"""simple docstring"""





	if len(__UpperCAmelCase      ) > 1:
		_lowercase			:     Dict      					=				len(__UpperCAmelCase      ) // 2  # Finds the middle of the array
		_lowercase			:     List[str]      					=				arr[
		    :middle_length
		]  # Creates an array of the elements in the first half.
		_lowercase			:     Optional[int]      					=				arr[
		    middle_length:
		]  # Creates an array of the elements in the second half.
		_lowercase			:     Optional[Any]      					=				len(__UpperCAmelCase      )
		_lowercase			:     Optional[int]      					=				len(__UpperCAmelCase      )
		merge(__UpperCAmelCase      )  # Starts sorting the left.
		merge(__UpperCAmelCase      )  # Starts sorting the right
		_lowercase			:     Dict      					=				0  # Left Counter
		_lowercase			:     List[str]      					=				0  # Right Counter
		_lowercase			:     Optional[Any]      					=				0  # Position Counter
		while (
		    left_index < left_size and right_index < right_size
		):  # Runs until the lowers size of the left and right are sorted.
			if left_array[left_index] < right_array[right_index]:
				_lowercase			:     Optional[int]      					=				left_array[left_index]
				left_index += 1
			else:
				_lowercase			:     int      					=				right_array[right_index]
				right_index += 1
			index += 1
		while (
		    left_index < left_size
		):  # Adds the left over elements in the left half of the array
			_lowercase			:     Any      					=				left_array[left_index]
			left_index += 1
			index += 1
		while (
		    right_index < right_size
		):  # Adds the left over elements in the right half of the array
			_lowercase			:     str      					=				right_array[right_index]
			right_index += 1
			index += 1
	return arr


if __name__ == "__main__":
						import doctest

						doctest.testmod()



