



'''simple docstring'''
from typing import Callable, Optional, Union

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


snake_case_			:     int  	=  logging.get_logger(__name__)

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






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





	def __init__(			self :    str			,lowerCamelCase__ :    Optional[float] = 0.1			,lowerCamelCase__ :    Optional[Union[str, Callable]] = "gelu"			,lowerCamelCase__ :    Optional[int] = 30522			,lowerCamelCase__ :    Optional[int] = 1024			,lowerCamelCase__ :    Optional[int] = 4096			,lowerCamelCase__ :    Optional[int] = 12			,lowerCamelCase__ :    Optional[int] = 16			,lowerCamelCase__ :    Optional[int] = 4096			,lowerCamelCase__ :    Optional[int] = 12			,lowerCamelCase__ :    Optional[int] = 16			,lowerCamelCase__ :    Optional[float] = 0.1			,lowerCamelCase__ :    Optional[float] = 0.1			,lowerCamelCase__ :    Optional[int] = 512			,lowerCamelCase__ :    Optional[float] = 0.0_2			,lowerCamelCase__ :    Optional[bool] = True			,lowerCamelCase__ :    Optional[bool] = True			,lowerCamelCase__ :    Optional[int] = 0			,lowerCamelCase__ :    Optional[int] = 2			,lowerCamelCase__ :    Optional[int] = 32			,lowerCamelCase__ :    Optional[int] = 128			,lowerCamelCase__ :    Optional[bool] = False			,lowerCamelCase__ :    Optional[float] = 0.0			,lowerCamelCase__ :    Optional[bool] = True			,lowerCamelCase__ :    Optional[int] = 0			,lowerCamelCase__ :    Optional[int] = 1			,lowerCamelCase__ :    Optional[int] = 2			,**lowerCamelCase__ :    Optional[int]			,):







							'''simple docstring'''
							_UpperCamelCase :		Tuple			    =       vocab_size
							_UpperCamelCase :		Tuple			    =       hidden_size
							_UpperCamelCase :		Tuple			    =       encoder_ffn_dim
							_UpperCamelCase :		int			    =       num_encoder_layers
							_UpperCamelCase :		int			    =       num_encoder_attention_heads
							_UpperCamelCase :		List[str]			    =       decoder_ffn_dim
							_UpperCamelCase :		Union[str, Any]			    =       num_decoder_layers
							_UpperCamelCase :		List[Any]			    =       num_decoder_attention_heads
							_UpperCamelCase :		Union[str, Any]			    =       max_position_embeddings
							_UpperCamelCase :		Any			    =       init_std  # Normal(0, this parameter)
							_UpperCamelCase :		str			    =       activation_function

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

							# 3 Types of Dropout
							_UpperCamelCase :		Optional[int]			    =       attention_dropout
							_UpperCamelCase :		Dict			    =       activation_dropout
							_UpperCamelCase :		Any			    =       dropout

							_UpperCamelCase :		Dict			    =       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      UpperCamelCase_  (			self :    Optional[Any]			):







							'''simple docstring'''
							return self.num_encoder_layers + self.num_decoder_layers





	@num_hidden_layers.setter
	def      UpperCamelCase_  (			self :    Optional[int]			,lowerCamelCase__ :    Optional[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`.'			)







'''simple docstring'''
from abc import ABC, abstractmethod
from argparse import ArgumentParser






class 							lowercase__     (							lowercase       ):





	@staticmethod
	@abstractmethod
	def      UpperCamelCase_  (			lowerCamelCase__ :    ArgumentParser			):







							'''simple docstring'''
							raise NotImplementedError()





	@abstractmethod
	def      UpperCamelCase_  (			self :    Any			):







							'''simple docstring'''
							raise NotImplementedError()


