
import warnings

from ...configuration_utils import PretrainedConfig
from ...utils import logging


__lowerCAmelCase			:     List[Any]           =   logging.get_logger(__name__)

__lowerCAmelCase			:     Optional[int]           =   {
    'xlnet-base-cased': 'https://huggingface.co/xlnet-base-cased/resolve/main/config.json',
    'xlnet-large-cased': 'https://huggingface.co/xlnet-large-cased/resolve/main/config.json',
}




class        UpperCAmelCase_			( _A     ):


  '''simple docstring'''







  a__           =		"""xlnet"""
  a__           =		["""mems"""]
  a__           =		{
      """n_token""": """vocab_size""",  # Backward compatibility
      """hidden_size""": """d_model""",
      """num_attention_heads""": """n_head""",
      """num_hidden_layers""": """n_layer""",
  }
  def __init__( self			: int			,							UpperCamelCase__			: List[str]=3_2000			,							UpperCamelCase__			: Optional[int]=1024			,							UpperCamelCase__			: Union[str, Any]=24			,							UpperCamelCase__			: Optional[int]=16			,							UpperCamelCase__			: List[str]=4096			,							UpperCamelCase__			: Union[str, Any]="gelu"			,							UpperCamelCase__			: Tuple=True			,							UpperCamelCase__			: Tuple="bi"			,							UpperCamelCase__			: List[str]=0.02			,							UpperCamelCase__			: List[str]=1E-12			,							UpperCamelCase__			: Tuple=0.1			,							UpperCamelCase__			: Tuple=512			,							UpperCamelCase__			: str=None			,							UpperCamelCase__			: Dict=True			,							UpperCamelCase__			: Optional[int]=False			,							UpperCamelCase__			: List[str]=False			,							UpperCamelCase__			: Any=-1			,							UpperCamelCase__			: Dict=False			,							UpperCamelCase__			: int="last"			,							UpperCamelCase__			: Optional[Any]=True			,							UpperCamelCase__			: List[Any]="tanh"			,							UpperCamelCase__			: Tuple=0.1			,							UpperCamelCase__			: List[str]=5			,							UpperCamelCase__			: Tuple=5			,							UpperCamelCase__			: str=5			,							UpperCamelCase__			: Optional[int]=1			,							UpperCamelCase__			: List[str]=2			,							**UpperCamelCase__			: List[Any]			,							)			->	Any:







    """simple docstring"""






    __magic_name__				     =       vocab_size
    __magic_name__				     =       d_model
    __magic_name__				     =       n_layer
    __magic_name__				     =       n_head
    if d_model % n_head != 0:
      raise ValueError(F'''\'d_model % n_head\' ({d_model % n_head}) should be equal to 0'''    )
    if "d_head" in kwargs:
      if kwargs["d_head"] != d_model // n_head:
        raise ValueError(
            F'''`d_head` ({kwargs['d_head']}) should be equal to `d_model // n_head` ({d_model // n_head})'''    )
    __magic_name__				     =       d_model // n_head
    __magic_name__				     =       ff_activation
    __magic_name__				     =       d_inner
    __magic_name__				     =       untie_r
    __magic_name__				     =       attn_type

    __magic_name__				     =       initializer_range
    __magic_name__				     =       layer_norm_eps

    __magic_name__				     =       dropout
    __magic_name__				     =       mem_len
    __magic_name__				     =       reuse_len
    __magic_name__				     =       bi_data
    __magic_name__				     =       clamp_len
    __magic_name__				     =       same_length

    __magic_name__				     =       summary_type
    __magic_name__				     =       summary_use_proj
    __magic_name__				     =       summary_activation
    __magic_name__				     =       summary_last_dropout
    __magic_name__				     =       start_n_top
    __magic_name__				     =       end_n_top

    __magic_name__				     =       bos_token_id
    __magic_name__				     =       pad_token_id
    __magic_name__				     =       eos_token_id

    if "use_cache" in kwargs:
      warnings.warn(
          """The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`"""
          """ instead."""			,							UpperCamelCase__			,							)
      __magic_name__				     =       kwargs["""use_cache"""]

    __magic_name__				     =       use_mems_eval
    __magic_name__				     =       use_mems_train
    super().__init__(pad_token_id=UpperCamelCase__			,							bos_token_id=UpperCamelCase__			,							eos_token_id=UpperCamelCase__			,							**UpperCamelCase__    )
  @property
  def 							_lowercase							( self			: int    )			->	Tuple:







    """simple docstring"""






    logger.info(F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''    )
    return -1





  @max_position_embeddings.setter
  def 							_lowercase							( self			: Any			,							UpperCamelCase__			: Optional[Any]    )			->	Dict:







    """simple docstring"""






    raise NotImplementedError(
        F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''    )


"""simple docstring"""






from ..utils import DummyObject, requires_backends





class  _A						(       metaclass=lowerCAmelCase	):
      snake_case__			:   List[str]							  =	['onnx']

      def __init__(						self		,       *__lowerCAmelCase		,       **__lowerCAmelCase						):







            """simple docstring"""



            requires_backends(self		,       ["""onnx"""]						)

      @classmethod
      def 				A__       (						cls		,       *__lowerCAmelCase		,       **__lowerCAmelCase						):







            """simple docstring"""



            requires_backends(cls		,       ["""onnx"""]						)







      @classmethod
      def 				A__       (						cls		,       *__lowerCAmelCase		,       **__lowerCAmelCase						):







            """simple docstring"""



            requires_backends(cls		,       ["""onnx"""]						)



