



'''simple docstring'''






from typing import Callable, Optional, Union

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


lowerCAmelCase:   Optional[int]					=		logging.get_logger(__name__)

lowerCAmelCase:   Union[str, Any]					=		{
    'microsoft/xprophetnet-large-wiki100-cased': (
        'https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json'
    ),
}

class 				a__(   lowerCamelCase__      ):
    lowercase__					=       """xlm-prophetnet"""
    lowercase__					=       ["""past_key_values"""]
    lowercase__					=       {
        """num_attention_heads""": """num_encoder_attention_heads""",
    }







    def __init__( self					:    List[str]		,     __snake_case					:    Optional[float] = 0.1		,     __snake_case					:    Optional[Union[str, Callable]] = "gelu"		,     __snake_case					:    Optional[int] = 3_05_22		,     __snake_case					:    Optional[int] = 10_24		,     __snake_case					:    Optional[int] = 40_96		,     __snake_case					:    Optional[int] = 12		,     __snake_case					:    Optional[int] = 16		,     __snake_case					:    Optional[int] = 40_96		,     __snake_case					:    Optional[int] = 12		,     __snake_case					:    Optional[int] = 16		,     __snake_case					:    Optional[float] = 0.1		,     __snake_case					:    Optional[float] = 0.1		,     __snake_case					:    Optional[int] = 5_12		,     __snake_case					:    Optional[float] = 0.02		,     __snake_case					:    Optional[bool] = True		,     __snake_case					:    Optional[bool] = True		,     __snake_case					:    Optional[int] = 0		,     __snake_case					:    Optional[int] = 2		,     __snake_case					:    Optional[int] = 32		,     __snake_case					:    Optional[int] = 1_28		,     __snake_case					:    Optional[bool] = False		,     __snake_case					:    Optional[float] = 0.0		,     __snake_case					:    Optional[bool] = True		,     __snake_case					:    Optional[int] = 0		,     __snake_case					:    Optional[int] = 1		,     __snake_case					:    Optional[int] = 2		,     **__snake_case					:    str		,     ):
      a		:   int	  =	vocab_size
      a		:   int	  =	hidden_size
      a		:   Dict	  =	encoder_ffn_dim
      a		:   int	  =	num_encoder_layers
      a		:   Dict	  =	num_encoder_attention_heads
      a		:   Any	  =	decoder_ffn_dim
      a		:   Any	  =	num_decoder_layers
      a		:   Optional[int]	  =	num_decoder_attention_heads
      a		:   Union[str, Any]	  =	max_position_embeddings
      a		:   Optional[int]	  =	init_std  # Normal(0, this parameter)
      a		:   Optional[Any]	  =	activation_function

      # parameters for xlmprophetnet
      a		:   str	  =	ngram
      a		:   Union[str, Any]	  =	num_buckets
      a		:   Tuple	  =	relative_max_distance
      a		:   str	  =	disable_ngram_loss
      a		:   Tuple	  =	eps

      # 3 Types of Dropout
      a		:   Union[str, Any]	  =	attention_dropout
      a		:   Dict	  =	activation_dropout
      a		:   int	  =	dropout

      a		:   Any	  =	use_cache

      super().__init__(
          pad_token_id=__snake_case		,     bos_token_id=__snake_case		,     eos_token_id=__snake_case		,     is_encoder_decoder=__snake_case		,     add_cross_attention=__snake_case		,     decoder_start_token_id=__snake_case		,     **__snake_case		,     )







    @property
    def      lowercase_			( self					:    Tuple      ):
      return self.num_encoder_layers + self.num_decoder_layers







    @num_hidden_layers.setter
    def      lowercase_			( self					:    str		,     __snake_case					:    List[str]      ):
      raise NotImplementedError(
          'This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and'
          ' `num_decoder_layers`.'      )




'''simple docstring'''






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


lowerCAmelCase:   List[str]					=		logging.get_logger(__name__)

lowerCAmelCase:   Union[str, Any]					=		{
    'SCUT-DLVCLab/lilt-roberta-en-base': (
        'https://huggingface.co/SCUT-DLVCLab/lilt-roberta-en-base/resolve/main/config.json'
    ),
}

class 				a__(   lowerCamelCase__      ):
    lowercase__					=       """lilt"""







    def __init__( self					:    str		,     __snake_case					:    Dict=3_05_22		,     __snake_case					:    int=7_68		,     __snake_case					:    Union[str, Any]=12		,     __snake_case					:    Optional[Any]=12		,     __snake_case					:    Dict=30_72		,     __snake_case					:    Tuple="gelu"		,     __snake_case					:    Dict=0.1		,     __snake_case					:    List[Any]=0.1		,     __snake_case					:    List[str]=5_12		,     __snake_case					:    List[str]=2		,     __snake_case					:    str=0.02		,     __snake_case					:    Dict=1e-1_2		,     __snake_case					:    int=0		,     __snake_case					:    Any="absolute"		,     __snake_case					:    Tuple=None		,     __snake_case					:    Tuple=4		,     __snake_case					:    List[str]=10_24		,     **__snake_case					:    Union[str, Any]		,     ):
      super().__init__(pad_token_id=__snake_case		,     **__snake_case      )

      a		:   str	  =	vocab_size
      a		:   Optional[Any]	  =	hidden_size
      a		:   Union[str, Any]	  =	num_hidden_layers
      a		:   Tuple	  =	num_attention_heads
      a		:   Optional[Any]	  =	hidden_act
      a		:   Union[str, Any]	  =	intermediate_size
      a		:   Optional[Any]	  =	hidden_dropout_prob
      a		:   Tuple	  =	attention_probs_dropout_prob
      a		:   str	  =	max_position_embeddings
      a		:   Any	  =	type_vocab_size
      a		:   Union[str, Any]	  =	initializer_range
      a		:   int	  =	layer_norm_eps
      a		:   Any	  =	position_embedding_type
      a		:   Any	  =	classifier_dropout
      a		:   str	  =	channel_shrink_ratio
      a		:   Optional[Any]	  =	max_ad_position_embeddings