'''simple docstring'''


from typing import Callable, Optional, Union

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


__snake_case						  =		logging.get_logger(__name__)

__snake_case						  =		{
    """microsoft/xprophetnet-large-wiki100-cased""": (
        """https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json"""
    ),
}





class       _a    (		__a      ):


  """simple docstring"""

  A_    							=						'''xlm-prophetnet'''
  A_    							=						['''past_key_values''']
  A_    							=						{
      '''num_attention_heads''': '''num_encoder_attention_heads''',
  }




  def __init__(		self      :       List[Any]   ,				lowercase_      :       Optional[float] = 0.1   ,				lowercase_      :       Optional[Union[str, Callable]] = "gelu"   ,				lowercase_      :       Optional[int] = 30_522   ,				lowercase_      :       Optional[int] = 1_024   ,				lowercase_      :       Optional[int] = 4_096   ,				lowercase_      :       Optional[int] = 12   ,				lowercase_      :       Optional[int] = 16   ,				lowercase_      :       Optional[int] = 4_096   ,				lowercase_      :       Optional[int] = 12   ,				lowercase_      :       Optional[int] = 16   ,				lowercase_      :       Optional[float] = 0.1   ,				lowercase_      :       Optional[float] = 0.1   ,				lowercase_      :       Optional[int] = 512   ,				lowercase_      :       Optional[float] = 0.0_2   ,				lowercase_      :       Optional[bool] = True   ,				lowercase_      :       Optional[bool] = True   ,				lowercase_      :       Optional[int] = 0   ,				lowercase_      :       Optional[int] = 2   ,				lowercase_      :       Optional[int] = 32   ,				lowercase_      :       Optional[int] = 128   ,				lowercase_      :       Optional[bool] = False   ,				lowercase_      :       Optional[float] = 0.0   ,				lowercase_      :       Optional[bool] = True   ,				lowercase_      :       Optional[int] = 0   ,				lowercase_      :       Optional[int] = 1   ,				lowercase_      :       Optional[int] = 2   ,				**lowercase_      :       str   ,				):







    '''simple docstring'''


    lowercase_     =       vocab_size
    lowercase_     =       hidden_size
    lowercase_     =       encoder_ffn_dim
    lowercase_     =       num_encoder_layers
    lowercase_     =       num_encoder_attention_heads
    lowercase_     =       decoder_ffn_dim
    lowercase_     =       num_decoder_layers
    lowercase_     =       num_decoder_attention_heads
    lowercase_     =       max_position_embeddings
    lowercase_     =       init_std  # Normal(0, this parameter)
    lowercase_     =       activation_function

    # parameters for xlmprophetnet
    lowercase_     =       ngram
    lowercase_     =       num_buckets
    lowercase_     =       relative_max_distance
    lowercase_     =       disable_ngram_loss
    lowercase_     =       eps

    # 3 Types of Dropout
    lowercase_     =       attention_dropout
    lowercase_     =       activation_dropout
    lowercase_     =       dropout

    lowercase_     =       use_cache

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




  @property
  def 		lowerCamelCase__  (		self      :       int      ):







    '''simple docstring'''


    return self.num_encoder_layers + self.num_decoder_layers





  @num_hidden_layers.setter
  def 		lowerCamelCase__  (		self      :       Tuple   ,				lowercase_      :       Optional[int]      ):







    '''simple docstring'''


    raise NotImplementedError(
        """This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and"""
        """ `num_decoder_layers`."""      )


'''simple docstring'''


def   A_      (       SCREAMING_SNAKE_CASE_						)			->bool:
  if number < 0:
    raise ValueError("""number must not be negative"""						)
  return number & (number - 1) == 0


if __name__ == "__main__":
       import doctest

       doctest.testmod()

