





from typing import Callable, Optional, Union

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


A_        =  logging.get_logger(__name__)

A_        =  {
    "microsoft/prophetnet-large-uncased": (
        "https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json"
    ),
}

class SCREAMING_SNAKE_CASE_			(       snake_case_ ):





					"""simple docstring"""


					A__								=     "prophetnet"
					A__								=     ["past_key_values"]
					A__								=     {
					    "num_attention_heads": "num_encoder_attention_heads",
					}





					def __init__(			self						,	_lowerCAmelCase = 0.1						,	_lowerCAmelCase = "gelu"						,	_lowerCAmelCase = 3_0522						,	_lowerCAmelCase = 1024						,	_lowerCAmelCase = 4096						,	_lowerCAmelCase = 12						,	_lowerCAmelCase = 16						,	_lowerCAmelCase = 4096						,	_lowerCAmelCase = 12						,	_lowerCAmelCase = 16						,	_lowerCAmelCase = 0.1						,	_lowerCAmelCase = 0.1						,	_lowerCAmelCase = 512						,	_lowerCAmelCase = 0.02						,	_lowerCAmelCase = True						,	_lowerCAmelCase = True						,	_lowerCAmelCase = 0						,	_lowerCAmelCase = 2						,	_lowerCAmelCase = 32						,	_lowerCAmelCase = 128						,	_lowerCAmelCase = False						,	_lowerCAmelCase = 0.0						,	_lowerCAmelCase = True						,	_lowerCAmelCase = 0						,	_lowerCAmelCase = 1						,	_lowerCAmelCase = 2						,	**_lowerCAmelCase						,	):
										lowerCamelCase__      =							vocab_size
										lowerCamelCase__      =							hidden_size
										lowerCamelCase__      =							encoder_ffn_dim
										lowerCamelCase__      =							num_encoder_layers
										lowerCamelCase__      =							num_encoder_attention_heads
										lowerCamelCase__      =							decoder_ffn_dim
										lowerCamelCase__      =							num_decoder_layers
										lowerCamelCase__      =							num_decoder_attention_heads
										lowerCamelCase__      =							max_position_embeddings
										lowerCamelCase__      =							init_std  # Normal(0, this parameter)
										lowerCamelCase__      =							activation_function

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

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

										lowerCamelCase__      =							use_cache

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





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






					@num_hidden_layers.setter
					def        __magic_name__			(			self						,	_lowerCAmelCase						):
										raise NotImplementedError(
										    "This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and"
										    " `num_decoder_layers`."						)





from typing import Callable, Optional, Union

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


SCREAMING_SNAKE_CASE__       			=				logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__       			=				{
    """microsoft/prophetnet-large-uncased""": (
        """https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json"""
    ),
}







class     __lowerCamelCase     (  snake_case_     ):


							"""simple docstring"""

							lowerCAmelCase__          =				"prophetnet"
							lowerCAmelCase__          =				["past_key_values"]
							lowerCAmelCase__          =				{
							    "num_attention_heads": "num_encoder_attention_heads",
							}




							def __init__(  self						,       UpperCAmelCase = 0.1						,       UpperCAmelCase = "gelu"						,       UpperCAmelCase = 30522						,       UpperCAmelCase = 1024						,       UpperCAmelCase = 4096						,       UpperCAmelCase = 12						,       UpperCAmelCase = 16						,       UpperCAmelCase = 4096						,       UpperCAmelCase = 12						,       UpperCAmelCase = 16						,       UpperCAmelCase = 0.1						,       UpperCAmelCase = 0.1						,       UpperCAmelCase = 512						,       UpperCAmelCase = 0.02						,       UpperCAmelCase = True						,       UpperCAmelCase = True						,       UpperCAmelCase = 0						,       UpperCAmelCase = 2						,       UpperCAmelCase = 32						,       UpperCAmelCase = 128						,       UpperCAmelCase = False						,       UpperCAmelCase = 0.0						,       UpperCAmelCase = True						,       UpperCAmelCase = 0						,       UpperCAmelCase = 1						,       UpperCAmelCase = 2						,       **UpperCAmelCase						,       )     ->       Dict:






								'''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 prophetnet
								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=UpperCAmelCase						,       bos_token_id=UpperCAmelCase						,       eos_token_id=UpperCAmelCase						,       is_encoder_decoder=UpperCAmelCase						,       add_cross_attention=UpperCAmelCase						,       decoder_start_token_id=UpperCAmelCase						,       **UpperCAmelCase						,       )




							@property
							def 				A__      (  self  )     ->       int:






								'''simple docstring'''






								return self.num_encoder_layers + self.num_decoder_layers




							@num_hidden_layers.setter
							def 				A__      (  self						,       UpperCAmelCase  )     ->       Any:






								'''simple docstring'''






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

