
"""simple docstring"""


from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


_lowercase				 =					{
    '''susnato/ernie-m-base_pytorch''': '''https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json''',
    '''susnato/ernie-m-large_pytorch''': '''https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json''',
}







class 					lowerCAmelCase_					(   _lowercase     ):



						'''simple docstring'''


						_lowerCamelCase:     Union[str, Any]   =     '''ernie_m'''
						_lowerCamelCase:     Dict[str, str]   =     {"dropout": "classifier_dropout", "num_classes": "num_labels"}


						def __init__(			self  :   Optional[Any]	,A_  :   int = 25_0002	,A_  :   int = 768	,A_  :   int = 12	,A_  :   int = 12	,A_  :   int = 3072	,A_  :   str = "gelu"	,A_  :   float = 0.1	,A_  :   float = 0.1	,A_  :   int = 514	,A_  :   float = 0.02	,A_  :   int = 1	,A_  :   float = 1e-05	,A_  :   Tuple=None	,A_  :   str=False	,A_  :   Tuple=0.0	,**A_  :   Optional[Any]	,)  -> Dict:
							super().__init__(pad_token_id=A_	,**A_   )
							A     = vocab_size
							A     = hidden_size
							A     = num_hidden_layers
							A     = num_attention_heads
							A     = intermediate_size
							A     = hidden_act
							A     = hidden_dropout_prob
							A     = attention_probs_dropout_prob
							A     = max_position_embeddings
							A     = initializer_range
							A     = layer_norm_eps
							A     = classifier_dropout
							A     = is_decoder
							A     = act_dropout


"""simple docstring"""




from typing import List

from .keymap import KEYMAP, get_character

def 						A							(  snake_case__     ):




			'''simple docstring'''


			def decorator(snake_case__     ):
						SCREAMING_SNAKE_CASE__										=   getattr(snake_case__		,					"""handle_key"""		,					[]     )
						handle += [key]
						setattr(snake_case__		,					"""handle_key"""		,					snake_case__     )
						return func

			return decorator

def 						A							(  *snake_case__     ):




			'''simple docstring'''


			def decorator(snake_case__     ):
						SCREAMING_SNAKE_CASE__										=   getattr(snake_case__		,					"""handle_key"""		,					[]     )
						handle += keys
						setattr(snake_case__		,					"""handle_key"""		,					snake_case__     )
						return func

			return decorator





class  lowerCamelCase    (A__      ):

			def __new__(       cls					:    Dict     ,					__UpperCAmelCase					:    Tuple     ,					__UpperCAmelCase					:    Any     ,					__UpperCAmelCase					:    Optional[Any]							) ->     List[str]:
						SCREAMING_SNAKE_CASE__										=   super().__new__(cls     ,					__UpperCAmelCase     ,					__UpperCAmelCase     ,					__UpperCAmelCase							)
						if not hasattr(__UpperCAmelCase     ,					"""key_handler"""							):
									setattr(__UpperCAmelCase     ,					"""key_handler"""     ,					{}							)
						setattr(__UpperCAmelCase     ,					"""handle_input"""     ,					KeyHandler.handle_input							)

						for value in attrs.values():
									SCREAMING_SNAKE_CASE__										=   getattr(__UpperCAmelCase     ,					"""handle_key"""     ,					[]							)
									for key in handled_keys:
												SCREAMING_SNAKE_CASE__										=   value
						return new_cls





			@staticmethod
			def        SCREAMING_SNAKE_CASE					(       cls					:    Tuple							) ->     Dict:
						SCREAMING_SNAKE_CASE__										=   get_character()
						if char != KEYMAP["undefined"]:
									SCREAMING_SNAKE_CASE__										=   ord(__UpperCAmelCase							)
						SCREAMING_SNAKE_CASE__										=   cls.key_handler.get(__UpperCAmelCase							)
						if handler:
									SCREAMING_SNAKE_CASE__										=   char
									return handler(cls							)
						else:
									return None

def 						A							(  cls     ):




			'''simple docstring'''


			return KeyHandler(cls.__name__		,					cls.__bases__		,					cls.__dict__.copy()     )


