






'''simple docstring'''





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


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

__A				:				Tuple					=		{
    """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   ):


    '''simple docstring'''

    lowerCAmelCase__   					=				"pegasus_x"
    lowerCAmelCase__   					=				["past_key_values"]
    lowerCAmelCase__   					=				{"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}

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

     '''simple docstring'''




     lowerCamelCase__	=  vocab_size
     lowerCamelCase__	=  max_position_embeddings
     lowerCamelCase__	=  d_model
     lowerCamelCase__	=  encoder_ffn_dim
     lowerCamelCase__	=  encoder_layers
     lowerCamelCase__	=  encoder_attention_heads
     lowerCamelCase__	=  decoder_ffn_dim
     lowerCamelCase__	=  decoder_layers
     lowerCamelCase__	=  decoder_attention_heads
     lowerCamelCase__	=  dropout
     lowerCamelCase__	=  attention_dropout
     lowerCamelCase__	=  activation_dropout
     lowerCamelCase__	=  activation_function
     lowerCamelCase__	=  init_std
     lowerCamelCase__	=  encoder_layerdrop
     lowerCamelCase__	=  decoder_layerdrop
     lowerCamelCase__	=  use_cache
     lowerCamelCase__	=  encoder_layers
     lowerCamelCase__	=  scale_embedding  # scale factor will be sqrt(d_model) if True

     lowerCamelCase__	=  num_global_tokens
     lowerCamelCase__	=  block_size
     lowerCamelCase__	=  stagger_local_blocks

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

    @property
    def  a__					(       self  :  Union[str, Any]  )				->				int:

     '''simple docstring'''




     return self.encoder_attention_heads




    @property
    def  a__					(       self  :  List[Any]  )				->				int:

     '''simple docstring'''




     return self.d_model









'''simple docstring'''





from ..utils import DummyObject, requires_backends
class 					lowercase							(				metaclass=_lowerCamelCase   ):


    '''simple docstring'''

    lowerCAmelCase__   					=				["torch", "transformers", "invisible_watermark"]

    def __init__(       self  :  Optional[Any]					,  *__lowerCamelCase  :  List[Any]					,  **__lowerCamelCase  :  Union[str, Any]  )				->				Dict:

     '''simple docstring'''




     requires_backends(self					,  ["torch", "transformers", "invisible_watermark"]  )

    @classmethod
    def  a__					(       cls  :  Any					,  *__lowerCamelCase  :  List[Any]					,  **__lowerCamelCase  :  Tuple  )				->				List[str]:

     '''simple docstring'''




     requires_backends(cls					,  ["torch", "transformers", "invisible_watermark"]  )




    @classmethod
    def  a__					(       cls  :  Union[str, Any]					,  *__lowerCamelCase  :  Tuple					,  **__lowerCamelCase  :  Tuple  )				->				List[Any]:

     '''simple docstring'''




     requires_backends(cls					,  ["torch", "transformers", "invisible_watermark"]  )
class 					lowercase							(				metaclass=_lowerCamelCase   ):


    '''simple docstring'''

    lowerCAmelCase__   					=				["torch", "transformers", "invisible_watermark"]

    def __init__(       self  :  Optional[Any]					,  *__lowerCamelCase  :  str					,  **__lowerCamelCase  :  Optional[Any]  )				->				str:

     '''simple docstring'''




     requires_backends(self					,  ["torch", "transformers", "invisible_watermark"]  )

    @classmethod
    def  a__					(       cls  :  Union[str, Any]					,  *__lowerCamelCase  :  List[str]					,  **__lowerCamelCase  :  Dict  )				->				Any:

     '''simple docstring'''




     requires_backends(cls					,  ["torch", "transformers", "invisible_watermark"]  )




    @classmethod
    def  a__					(       cls  :  List[Any]					,  *__lowerCamelCase  :  Union[str, Any]					,  **__lowerCamelCase  :  Any  )				->				Any:

     '''simple docstring'''




     requires_backends(cls					,  ["torch", "transformers", "invisible_watermark"]  )

