




"""simple docstring"""





from collections import OrderedDict
from typing import Mapping

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


_lowercase						   =     logging.get_logger(__name__)

_lowercase						   =     {
    """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    __lowercase							(      snake_case_						):


				'''simple docstring'''


				_lowerCAmelCase						      ="ernie"

				def __init__( self :  Tuple   ,SCREAMING_SNAKE_CASE_ :  Dict=3_0_5_2_2   ,SCREAMING_SNAKE_CASE_ :  List[str]=7_6_8   ,SCREAMING_SNAKE_CASE_ :  Optional[Any]=1_2   ,SCREAMING_SNAKE_CASE_ :  List[str]=1_2   ,SCREAMING_SNAKE_CASE_ :  str=3_0_7_2   ,SCREAMING_SNAKE_CASE_ :  Optional[Any]="gelu"   ,SCREAMING_SNAKE_CASE_ :  Optional[int]=0.1   ,SCREAMING_SNAKE_CASE_ :  Optional[int]=0.1   ,SCREAMING_SNAKE_CASE_ :  List[str]=5_1_2   ,SCREAMING_SNAKE_CASE_ :  Optional[Any]=2   ,SCREAMING_SNAKE_CASE_ :  Dict=3   ,SCREAMING_SNAKE_CASE_ :  Optional[Any]=False   ,SCREAMING_SNAKE_CASE_ :  Dict=0.02   ,SCREAMING_SNAKE_CASE_ :  Optional[int]=1E-12   ,SCREAMING_SNAKE_CASE_ :  Dict=0   ,SCREAMING_SNAKE_CASE_ :  Any="absolute"   ,SCREAMING_SNAKE_CASE_ :  List[str]=True   ,SCREAMING_SNAKE_CASE_ :  List[str]=None   ,**SCREAMING_SNAKE_CASE_ :  List[str]   ,):
										super().__init__(pad_token_id=SCREAMING_SNAKE_CASE_   ,**SCREAMING_SNAKE_CASE_   )

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







class    __lowercase							(      snake_case_						):


				'''simple docstring'''


				@property
				def    _lowerCamelCase       ( self :  int   ):
										if self.task == "multiple-choice":
																snake_case__							:       Any				      =       {0: '''batch''', 1: '''choice''', 2: '''sequence'''}
										else:
																snake_case__							:       Optional[int]				      =       {0: '''batch''', 1: '''sequence'''}
										return OrderedDict(
										    [
										        ('''input_ids''', dynamic_axis),
										        ('''attention_mask''', dynamic_axis),
										        ('''token_type_ids''', dynamic_axis),
										        ('''task_type_ids''', dynamic_axis),
										    ]   )








"""simple docstring"""





from __future__ import annotations

from enum import Enum, unique
from typing import TypeVar

# Create a generic variable that can be 'Enum', or any subclass.
_lowercase						   =     TypeVar("""T""", bound="""Enum""")

@unique
class    __lowercase							(      snake_case_						):


				'''simple docstring'''


				_lowerCAmelCase						      =80
				_lowerCAmelCase						      =70
				_lowerCAmelCase						      =60
				_lowerCAmelCase						      =50
				_lowerCAmelCase						      =40
				_lowerCAmelCase						      =30
				_lowerCAmelCase						      =20
				_lowerCAmelCase						      =10







@unique
class    __lowercase							(      snake_case_						):


				'''simple docstring'''


				_lowerCAmelCase						      =24
				_lowerCAmelCase						      =21
				_lowerCAmelCase						      =18
				_lowerCAmelCase						      =15
				_lowerCAmelCase						      =12
				_lowerCAmelCase						      =9
				_lowerCAmelCase						      =6
				_lowerCAmelCase						      =3
				_lowerCAmelCase						      =2
				_lowerCAmelCase						      =1
				_lowerCAmelCase						      =-1
				_lowerCAmelCase						      =-2
				_lowerCAmelCase						      =-3
				_lowerCAmelCase						      =-6
				_lowerCAmelCase						      =-9
				_lowerCAmelCase						      =-12
				_lowerCAmelCase						      =-15
				_lowerCAmelCase						      =-18
				_lowerCAmelCase						      =-21
				_lowerCAmelCase						      =-24

				@classmethod
				def    _lowerCamelCase       ( cls :  type[T]   ):
										return {unit.name: unit.value for unit in cls if unit.value > 0}





				@classmethod
				def    _lowerCamelCase       ( cls :  type[T]   ):
										return {unit.name: unit.value for unit in cls if unit.value < 0}







def 		lowerCAmelCase				(			lowerCamelCase		):
						'''simple docstring'''


						snake_case__							:       List[Any]				      =       SIUnit.get_positive() if value > 0 else SIUnit.get_negative()
						for name_prefix, value_prefix in prefixes.items():
												snake_case__							:       Optional[int]				      =       value / (10**value_prefix)
												if numerical_part > 1:
																		return f'''{numerical_part!s} {name_prefix}'''
						return str(lowerCamelCase		)

def 		lowerCAmelCase				(			lowerCamelCase		):
						'''simple docstring'''


						for prefix in BinaryUnit:
												snake_case__							:       int				      =       value / (2**prefix.value)
												if numerical_part > 1:
																		return f'''{numerical_part!s} {prefix.name}'''
						return str(lowerCamelCase		)


if __name__ == "__main__":
							import doctest

							doctest.testmod()


