

'''simple docstring'''



from typing import Callable, Optional, Union

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


UpperCAmelCase				: Optional[Any]         =  logging.get_logger(__name__)

UpperCAmelCase				: Optional[int]         =  {
    'microsoft/prophetnet-large-uncased': (
        'https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json'
    ),
}







class 		lowerCAmelCase__     (   a      ):



 """simple docstring"""



 lowerCAmelCase__						      =   "prophetnet"
 lowerCAmelCase__						      =   ["past_key_values"]
 lowerCAmelCase__						      =   {
     "num_attention_heads": "num_encoder_attention_heads",
 }
 def __init__(	self      : Optional[Any]      ,							__SCREAMING_SNAKE_CASE      : Optional[float] = 0.1      ,							__SCREAMING_SNAKE_CASE      : Optional[Union[str, Callable]] = "gelu"      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 30_522      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 1_024      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 4_096      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 12      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 16      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 4_096      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 12      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 16      ,							__SCREAMING_SNAKE_CASE      : Optional[float] = 0.1      ,							__SCREAMING_SNAKE_CASE      : Optional[float] = 0.1      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 512      ,							__SCREAMING_SNAKE_CASE      : Optional[float] = 0.02      ,							__SCREAMING_SNAKE_CASE      : Optional[bool] = True      ,							__SCREAMING_SNAKE_CASE      : Optional[bool] = True      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 0      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 2      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 32      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 128      ,							__SCREAMING_SNAKE_CASE      : Optional[bool] = False      ,							__SCREAMING_SNAKE_CASE      : Optional[float] = 0.0      ,							__SCREAMING_SNAKE_CASE      : Optional[bool] = True      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 0      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 1      ,							__SCREAMING_SNAKE_CASE      : Optional[int] = 2      ,							**__SCREAMING_SNAKE_CASE      : List[Any]      ,							)						->				List[str]:


      """simple docstring"""




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

      # parameters for prophetnet
      __SCREAMING_SNAKE_CASE						     =   ngram
      __SCREAMING_SNAKE_CASE						     =   num_buckets
      __SCREAMING_SNAKE_CASE						     =   relative_max_distance
      __SCREAMING_SNAKE_CASE						     =   disable_ngram_loss
      __SCREAMING_SNAKE_CASE						     =   eps

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

      __SCREAMING_SNAKE_CASE						     =   use_cache

      super().__init__(
          pad_token_id=__SCREAMING_SNAKE_CASE      ,							bos_token_id=__SCREAMING_SNAKE_CASE      ,							eos_token_id=__SCREAMING_SNAKE_CASE      ,							is_encoder_decoder=__SCREAMING_SNAKE_CASE      ,							add_cross_attention=__SCREAMING_SNAKE_CASE      ,							decoder_start_token_id=__SCREAMING_SNAKE_CASE      ,							**__SCREAMING_SNAKE_CASE      ,							)
 @property
 def    UpperCAmelCase__	(	self      : Dict    )						->				int:


      """simple docstring"""




      return self.num_encoder_layers + self.num_decoder_layers


 @num_hidden_layers.setter
 def    UpperCAmelCase__	(	self      : str      ,							__SCREAMING_SNAKE_CASE      : Dict    )						->				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'''



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


UpperCAmelCase				: Union[str, Any]         =  logging.get_logger(__name__)

UpperCAmelCase				: Optional[int]         =  {
    'bert-base-uncased': 'https://huggingface.co/bert-base-uncased/resolve/main/config.json',
    # QDQBERT models can be loaded from any BERT checkpoint, available at https://huggingface.co/models?filter=bert
}







class 		lowerCAmelCase__     (   a      ):



 """simple docstring"""



 lowerCAmelCase__						      =   "qdqbert"
 def __init__(	self      : str      ,							__SCREAMING_SNAKE_CASE      : Optional[int]=30_522      ,							__SCREAMING_SNAKE_CASE      : str=768      ,							__SCREAMING_SNAKE_CASE      : Union[str, Any]=12      ,							__SCREAMING_SNAKE_CASE      : Any=12      ,							__SCREAMING_SNAKE_CASE      : Any=3_072      ,							__SCREAMING_SNAKE_CASE      : List[str]="gelu"      ,							__SCREAMING_SNAKE_CASE      : Any=0.1      ,							__SCREAMING_SNAKE_CASE      : Any=0.1      ,							__SCREAMING_SNAKE_CASE      : Optional[int]=512      ,							__SCREAMING_SNAKE_CASE      : List[str]=2      ,							__SCREAMING_SNAKE_CASE      : Dict=0.02      ,							__SCREAMING_SNAKE_CASE      : List[str]=1E-12      ,							__SCREAMING_SNAKE_CASE      : str=True      ,							__SCREAMING_SNAKE_CASE      : Optional[int]=1      ,							__SCREAMING_SNAKE_CASE      : Optional[int]=0      ,							__SCREAMING_SNAKE_CASE      : Dict=2      ,							**__SCREAMING_SNAKE_CASE      : Union[str, Any]      ,							)						->				str:


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

      __SCREAMING_SNAKE_CASE						     =   vocab_size
      __SCREAMING_SNAKE_CASE						     =   max_position_embeddings
      __SCREAMING_SNAKE_CASE						     =   hidden_size
      __SCREAMING_SNAKE_CASE						     =   num_hidden_layers
      __SCREAMING_SNAKE_CASE						     =   num_attention_heads
      __SCREAMING_SNAKE_CASE						     =   intermediate_size
      __SCREAMING_SNAKE_CASE						     =   hidden_act
      __SCREAMING_SNAKE_CASE						     =   hidden_dropout_prob
      __SCREAMING_SNAKE_CASE						     =   attention_probs_dropout_prob
      __SCREAMING_SNAKE_CASE						     =   initializer_range
      __SCREAMING_SNAKE_CASE						     =   type_vocab_size
      __SCREAMING_SNAKE_CASE						     =   layer_norm_eps
      __SCREAMING_SNAKE_CASE						     =   use_cache






