



"""simple docstring"""





from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


__lowerCAmelCase							:       List[str]          =       {
    '''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     (					SCREAMING_SNAKE_CASE__		):





		"""simple docstring"""






		_lowerCamelCase      	=							'''ernie_m'''
		_lowerCamelCase      	=							{"dropout": "classifier_dropout", "num_classes": "num_labels"}





		def __init__(       self				,     _lowercase = 2_5_0_0_0_2				,     _lowercase = 7_6_8				,     _lowercase = 1_2				,     _lowercase = 1_2				,     _lowercase = 3_0_7_2				,     _lowercase = "gelu"				,     _lowercase = 0.1				,     _lowercase = 0.1				,     _lowercase = 5_1_4				,     _lowercase = 0.02				,     _lowercase = 1				,     _lowercase = 1E-05				,     _lowercase=None				,     _lowercase=False				,     _lowercase=0.0				,     **_lowercase				,     )			->    Any:







								'''simple docstring'''

								super().__init__(pad_token_id=_lowercase				,     **_lowercase )
								snake_case_ :			Optional[int]            =      vocab_size
								snake_case_ :			Dict            =      hidden_size
								snake_case_ :			Optional[int]            =      num_hidden_layers
								snake_case_ :			List[str]            =      num_attention_heads
								snake_case_ :			str            =      intermediate_size
								snake_case_ :			int            =      hidden_act
								snake_case_ :			Any            =      hidden_dropout_prob
								snake_case_ :			Any            =      attention_probs_dropout_prob
								snake_case_ :			int            =      max_position_embeddings
								snake_case_ :			Optional[Any]            =      initializer_range
								snake_case_ :			Union[str, Any]            =      layer_norm_eps
								snake_case_ :			Optional[int]            =      classifier_dropout
								snake_case_ :			List[str]            =      is_decoder
								snake_case_ :			Optional[int]            =      act_dropout







'''simple docstring'''







from torch import nn







def 						_A      ( UpperCAmelCase						):






   '''simple docstring'''







   if act_fn in ["swish", "silu"]:
      return nn.SiLU()
   elif act_fn == "mish":
      return nn.Mish()
   elif act_fn == "gelu":
      return nn.GELU()
   else:
      raise ValueError(F"""Unsupported activation function: {act_fn}"""						)


