



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


UpperCAmelCase__			:   Any      			=    logging.get_logger(__name__)

UpperCAmelCase__			:   Optional[int]      			=    {
    '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 							lowerCAmelCase_		(		lowercase_     ):
		SCREAMING_SNAKE_CASE_       :			List[str]					       =	"""pegasus_x"""
		SCREAMING_SNAKE_CASE_       :			int					       =	["""past_key_values"""]
		SCREAMING_SNAKE_CASE_       :			int					       =	{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}







		def __init__(    self  :   Optional[int]       ,		UpperCAmelCase_  :   List[str]=96103       ,		UpperCAmelCase_  :   Dict=16384       ,		UpperCAmelCase_  :   Dict=16       ,		UpperCAmelCase_  :   Dict=4096       ,		UpperCAmelCase_  :   Optional[Any]=16       ,		UpperCAmelCase_  :   Tuple=16       ,		UpperCAmelCase_  :   Optional[Any]=4096       ,		UpperCAmelCase_  :   str=16       ,		UpperCAmelCase_  :   List[str]=0.0       ,		UpperCAmelCase_  :   Optional[Any]=0.0       ,		UpperCAmelCase_  :   Union[str, Any]=True       ,		UpperCAmelCase_  :   Dict=True       ,		UpperCAmelCase_  :   str="gelu"       ,		UpperCAmelCase_  :   Dict=1024       ,		UpperCAmelCase_  :   Dict=0.1       ,		UpperCAmelCase_  :   Optional[Any]=0.0       ,		UpperCAmelCase_  :   List[str]=0.0       ,		UpperCAmelCase_  :   Union[str, Any]=0.02       ,		UpperCAmelCase_  :   Union[str, Any]=0       ,		UpperCAmelCase_  :   Dict=True       ,		UpperCAmelCase_  :   List[Any]=0       ,		UpperCAmelCase_  :   Union[str, Any]=1       ,		UpperCAmelCase_  :   Optional[Any]=1       ,		UpperCAmelCase_  :   str=32       ,		UpperCAmelCase_  :   int=512       ,		UpperCAmelCase_  :   List[Any]=True       ,		**UpperCAmelCase_  :   str       ,		)       ->		List[Any]:


						'''simple docstring'''







						_UpperCAmelCase						:  Any     					=	vocab_size
						_UpperCAmelCase						:  Any     					=	max_position_embeddings
						_UpperCAmelCase						:  Tuple     					=	d_model
						_UpperCAmelCase						:  Any     					=	encoder_ffn_dim
						_UpperCAmelCase						:  Optional[Any]     					=	encoder_layers
						_UpperCAmelCase						:  Optional[int]     					=	encoder_attention_heads
						_UpperCAmelCase						:  Union[str, Any]     					=	decoder_ffn_dim
						_UpperCAmelCase						:  int     					=	decoder_layers
						_UpperCAmelCase						:  Any     					=	decoder_attention_heads
						_UpperCAmelCase						:  Optional[int]     					=	dropout
						_UpperCAmelCase						:  str     					=	attention_dropout
						_UpperCAmelCase						:  Optional[Any]     					=	activation_dropout
						_UpperCAmelCase						:  Any     					=	activation_function
						_UpperCAmelCase						:  List[str]     					=	init_std
						_UpperCAmelCase						:  Any     					=	encoder_layerdrop
						_UpperCAmelCase						:  Optional[Any]     					=	decoder_layerdrop
						_UpperCAmelCase						:  List[Any]     					=	use_cache
						_UpperCAmelCase						:  List[str]     					=	encoder_layers
						_UpperCAmelCase						:  Optional[Any]     					=	scale_embedding  # scale factor will be sqrt(d_model) if True

						_UpperCAmelCase						:  str     					=	num_global_tokens
						_UpperCAmelCase						:  Tuple     					=	block_size
						_UpperCAmelCase						:  Tuple     					=	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 					a_  (    self  :   Tuple					)       ->		int:


						'''simple docstring'''







						return self.encoder_attention_heads







		@property
		def 					a_  (    self  :   int					)       ->		int:


						'''simple docstring'''







						return self.d_model





from typing import TYPE_CHECKING

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


UpperCAmelCase__			:   Optional[Any]      			=    {}

try:
					if not is_sentencepiece_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCAmelCase__			:   List[Any]      			=    ['MBart50Tokenizer']

try:
					if not is_tokenizers_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCAmelCase__			:   int      			=    ['MBart50TokenizerFast']


if TYPE_CHECKING:
					try:
										if not is_sentencepiece_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .tokenization_mbartaa import MBartaaTokenizer

					try:
										if not is_tokenizers_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .tokenization_mbartaa_fast import MBartaaTokenizerFast

else:
					import sys

					UpperCAmelCase__			:   str      			=    _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
