

from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig


__lowercase     : Optional[Any]       =						{
    '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/config.json''',
    '''albert-large-v1''': '''https://huggingface.co/albert-large-v1/resolve/main/config.json''',
    '''albert-xlarge-v1''': '''https://huggingface.co/albert-xlarge-v1/resolve/main/config.json''',
    '''albert-xxlarge-v1''': '''https://huggingface.co/albert-xxlarge-v1/resolve/main/config.json''',
    '''albert-base-v2''': '''https://huggingface.co/albert-base-v2/resolve/main/config.json''',
    '''albert-large-v2''': '''https://huggingface.co/albert-large-v2/resolve/main/config.json''',
    '''albert-xlarge-v2''': '''https://huggingface.co/albert-xlarge-v2/resolve/main/config.json''',
    '''albert-xxlarge-v2''': '''https://huggingface.co/albert-xxlarge-v2/resolve/main/config.json''',
}



class 						_A     (				snake_case				):





  '''simple docstring'''



  __lowerCamelCase			:      int					=   '''albert'''





  def __init__(  self   ,SCREAMING_SNAKE_CASE_=30000   ,SCREAMING_SNAKE_CASE_=128   ,SCREAMING_SNAKE_CASE_=4096   ,SCREAMING_SNAKE_CASE_=12   ,SCREAMING_SNAKE_CASE_=1   ,SCREAMING_SNAKE_CASE_=64   ,SCREAMING_SNAKE_CASE_=16384   ,SCREAMING_SNAKE_CASE_=1   ,SCREAMING_SNAKE_CASE_="gelu_new"   ,SCREAMING_SNAKE_CASE_=0   ,SCREAMING_SNAKE_CASE_=0   ,SCREAMING_SNAKE_CASE_=512   ,SCREAMING_SNAKE_CASE_=2   ,SCREAMING_SNAKE_CASE_=0.02   ,SCREAMING_SNAKE_CASE_=1E-12   ,SCREAMING_SNAKE_CASE_=0.1   ,SCREAMING_SNAKE_CASE_="absolute"   ,SCREAMING_SNAKE_CASE_=0   ,SCREAMING_SNAKE_CASE_=2   ,SCREAMING_SNAKE_CASE_=3   ,**SCREAMING_SNAKE_CASE_   ,):

      '''simple docstring'''
      super().__init__(pad_token_id=SCREAMING_SNAKE_CASE_   ,bos_token_id=SCREAMING_SNAKE_CASE_   ,eos_token_id=SCREAMING_SNAKE_CASE_   ,**SCREAMING_SNAKE_CASE_    )

      snake_case							:		List[str]        =		vocab_size
      snake_case							:		int        =		embedding_size
      snake_case							:		int        =		hidden_size
      snake_case							:		List[Any]        =		num_hidden_layers
      snake_case							:		int        =		num_hidden_groups
      snake_case							:		List[str]        =		num_attention_heads
      snake_case							:		List[str]        =		inner_group_num
      snake_case							:		Any        =		hidden_act
      snake_case							:		Any        =		intermediate_size
      snake_case							:		Union[str, Any]        =		hidden_dropout_prob
      snake_case							:		List[Any]        =		attention_probs_dropout_prob
      snake_case							:		Tuple        =		max_position_embeddings
      snake_case							:		Any        =		type_vocab_size
      snake_case							:		Optional[Any]        =		initializer_range
      snake_case							:		int        =		layer_norm_eps
      snake_case							:		Optional[int]        =		classifier_dropout_prob
      snake_case							:		str        =		position_embedding_type







class 						_A     (				snake_case				):





  '''simple docstring'''



  @property
  def    snake_case_       (  self    ):

      '''simple docstring'''
      if self.task == "multiple-choice":
          snake_case							:		List[Any]        =		{0: """batch""", 1: """choice""", 2: """sequence"""}
      else:
          snake_case							:		int        =		{0: """batch""", 1: """sequence"""}
      return OrderedDict(
          [
              ("""input_ids""", dynamic_axis),
              ("""attention_mask""", dynamic_axis),
              ("""token_type_ids""", dynamic_axis),
          ]    )









'''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}"""						)


