




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


UpperCamelCase__       				=	logging.get_logger(__name__)

UpperCamelCase__       				=	{
    '''google/pegasus-x-base''': '''https://huggingface.co/google/pegasus-x-base/resolve/main/config.json''',
    '''google/pegasus-x-large''': '''https://huggingface.co/google/pegasus-x-large/resolve/main/config.json''',
    # See all PEGASUS-X models at https://huggingface.co/models?filter=pegasus-x
}
class 							__lowercase   (			lowerCAmelCase_    ):
     _lowerCAmelCase		       =						'''pegasus_x'''
     _lowerCAmelCase		       =						['''past_key_values''']
     _lowerCAmelCase		       =						{'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}



     def __init__(  self   :							Any      ,		lowercase__   :							Tuple=9_6_1_0_3      ,		lowercase__   :							List[str]=1_6_3_8_4      ,		lowercase__   :							Any=1_6      ,		lowercase__   :							Dict=4_0_9_6      ,		lowercase__   :							str=1_6      ,		lowercase__   :							Union[str, Any]=1_6      ,		lowercase__   :							str=4_0_9_6      ,		lowercase__   :							Any=1_6      ,		lowercase__   :							str=0.0      ,		lowercase__   :							Dict=0.0      ,		lowercase__   :							Union[str, Any]=True      ,		lowercase__   :							Union[str, Any]=True      ,		lowercase__   :							List[str]="gelu"      ,		lowercase__   :							Dict=1_0_2_4      ,		lowercase__   :							str=0.1      ,		lowercase__   :							str=0.0      ,		lowercase__   :							Optional[Any]=0.0      ,		lowercase__   :							str=0.02      ,		lowercase__   :							Optional[Any]=0      ,		lowercase__   :							Tuple=True      ,		lowercase__   :							Tuple=0      ,		lowercase__   :							Optional[int]=1      ,		lowercase__   :							List[Any]=1      ,		lowercase__   :							List[Any]=3_2      ,		lowercase__   :							Optional[int]=5_1_2      ,		lowercase__   :							Any=True      ,		**lowercase__   :							Dict      ,		):
       a_		    =  vocab_size
       a_		    =  max_position_embeddings
       a_		    =  d_model
       a_		    =  encoder_ffn_dim
       a_		    =  encoder_layers
       a_		    =  encoder_attention_heads
       a_		    =  decoder_ffn_dim
       a_		    =  decoder_layers
       a_		    =  decoder_attention_heads
       a_		    =  dropout
       a_		    =  attention_dropout
       a_		    =  activation_dropout
       a_		    =  activation_function
       a_		    =  init_std
       a_		    =  encoder_layerdrop
       a_		    =  decoder_layerdrop
       a_		    =  use_cache
       a_		    =  encoder_layers
       a_		    =  scale_embedding  # scale factor will be sqrt(d_model) if True

       a_		    =  num_global_tokens
       a_		    =  block_size
       a_		    =  stagger_local_blocks

       super().__init__(
           pad_token_id=UpperCamelCase_      ,		eos_token_id=UpperCamelCase_      ,		is_encoder_decoder=UpperCamelCase_      ,		decoder_start_token_id=UpperCamelCase_      ,		forced_eos_token_id=UpperCamelCase_      ,		**UpperCamelCase_      ,		)



     @property
     def 				__magic_name__		(  self   :							List[str]       ):
       return self.encoder_attention_heads



     @property
     def 				__magic_name__		(  self   :							int       ):
       return self.d_model


'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_torch_available


__lowercase	=    {
    '''configuration_xlm_prophetnet''': ['''XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''XLMProphetNetConfig'''],
}

try:
							if not is_sentencepiece_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__lowercase	=    ['''XLMProphetNetTokenizer''']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__lowercase	=    [
							    '''XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''XLMProphetNetDecoder''',
							    '''XLMProphetNetEncoder''',
							    '''XLMProphetNetForCausalLM''',
							    '''XLMProphetNetForConditionalGeneration''',
							    '''XLMProphetNetModel''',
							    '''XLMProphetNetPreTrainedModel''',
							]


if TYPE_CHECKING:
							from .configuration_xlm_prophetnet import XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMProphetNetConfig

							try:
														if not is_sentencepiece_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_xlm_prophetnet import XLMProphetNetTokenizer

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_xlm_prophetnet import (
														    XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST,
														    XLMProphetNetDecoder,
														    XLMProphetNetEncoder,
														    XLMProphetNetForCausalLM,
														    XLMProphetNetForConditionalGeneration,
														    XLMProphetNetModel,
														    XLMProphetNetPreTrainedModel,
														)

else:
							import sys

							__lowercase	=    _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






