




from collections import OrderedDict
from typing import Mapping

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


__a  :		Optional[int]		     =   logging.get_logger(__name__)

__a  :		str		     =   {
    '''nghuyong/ernie-1.0-base-zh''': '''https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json''',
    '''nghuyong/ernie-2.0-base-en''': '''https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json''',
    '''nghuyong/ernie-2.0-large-en''': '''https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json''',
    '''nghuyong/ernie-3.0-base-zh''': '''https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json''',
    '''nghuyong/ernie-3.0-medium-zh''': '''https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json''',
    '''nghuyong/ernie-3.0-mini-zh''': '''https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json''',
    '''nghuyong/ernie-3.0-micro-zh''': '''https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json''',
    '''nghuyong/ernie-3.0-nano-zh''': '''https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json''',
    '''nghuyong/ernie-gram-zh''': '''https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json''',
    '''nghuyong/ernie-health-zh''': '''https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json''',
}







class 				UpperCAmelCase(					snake_case_					):



	"""simple docstring"""






	a     : Tuple	  =					"""ernie"""

	def __init__(					self	,				lowerCamelCase=30522	,				lowerCamelCase=768	,				lowerCamelCase=12	,				lowerCamelCase=12	,				lowerCamelCase=3072	,				lowerCamelCase="gelu"	,				lowerCamelCase=0.1	,				lowerCamelCase=0.1	,				lowerCamelCase=512	,				lowerCamelCase=2	,				lowerCamelCase=3	,				lowerCamelCase=False	,				lowerCamelCase=0.02	,				lowerCamelCase=1E-12	,				lowerCamelCase=0	,				lowerCamelCase="absolute"	,				lowerCamelCase=True	,				lowerCamelCase=None	,				**lowerCamelCase	,				) ->      str:





								"""simple docstring"""


								super().__init__(pad_token_id=lowerCamelCase	,				**lowerCamelCase    )

								lowercase__  :	Tuple        =							vocab_size
								lowercase__  :	Dict        =							hidden_size
								lowercase__  :	List[str]        =							num_hidden_layers
								lowercase__  :	List[str]        =							num_attention_heads
								lowercase__  :	Optional[Any]        =							hidden_act
								lowercase__  :	int        =							intermediate_size
								lowercase__  :	List[str]        =							hidden_dropout_prob
								lowercase__  :	Any        =							attention_probs_dropout_prob
								lowercase__  :	Tuple        =							max_position_embeddings
								lowercase__  :	Any        =							type_vocab_size
								lowercase__  :	Optional[int]        =							task_type_vocab_size
								lowercase__  :	str        =							use_task_id
								lowercase__  :	Union[str, Any]        =							initializer_range
								lowercase__  :	Dict        =							layer_norm_eps
								lowercase__  :	Dict        =							position_embedding_type
								lowercase__  :	List[str]        =							use_cache
								lowercase__  :	int        =							classifier_dropout







class 				UpperCAmelCase(					snake_case_					):



	"""simple docstring"""






	@property
	def    __a     (					self    ) ->      Mapping[str, Mapping[int, str]]:





								"""simple docstring"""


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





def  snake_case_					(		SCREAMING_SNAKE_CASE_    )      ->			list:
							lowercase__  :	Optional[Any]        =							len(SCREAMING_SNAKE_CASE_    )

							# Set the gap value to be decreased by a factor of 1.3
							# after each iteration
							lowercase__  :	Tuple        =							1.3

							# Continue sorting until the gap is 1
							while gap > 1:
														# Decrease the gap value
														lowercase__  :	Tuple        =							int(gap / shrink    )

														# Sort the elements using insertion sort
														for i in range(SCREAMING_SNAKE_CASE_    ,len(SCREAMING_SNAKE_CASE_    )    ):
																					lowercase__  :	int        =							collection[i]
																					lowercase__  :	Union[str, Any]        =							i
																					while j >= gap and collection[j - gap] > temp:
																												lowercase__  :	str        =							collection[j - gap]
																												j -= gap
																					lowercase__  :	List[Any]        =							temp

							return collection


if __name__ == "__main__":
						import doctest

						doctest.testmod()