



"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


A:   List[str]								=		{"configuration_mbart": ["MBART_PRETRAINED_CONFIG_ARCHIVE_MAP", "MBartConfig", "MBartOnnxConfig"]}

try:
      if not is_sentencepiece_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   List[Any]								=		["MBartTokenizer"]

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   List[Any]								=		["MBartTokenizerFast"]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   List[str]								=		[
          "MBART_PRETRAINED_MODEL_ARCHIVE_LIST",
          "MBartForCausalLM",
          "MBartForConditionalGeneration",
          "MBartForQuestionAnswering",
          "MBartForSequenceClassification",
          "MBartModel",
          "MBartPreTrainedModel",
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   Optional[int]								=		[
          "TFMBartForConditionalGeneration",
          "TFMBartModel",
          "TFMBartPreTrainedModel",
      ]

try:
      if not is_flax_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   Optional[int]								=		[
          "FlaxMBartForConditionalGeneration",
          "FlaxMBartForQuestionAnswering",
          "FlaxMBartForSequenceClassification",
          "FlaxMBartModel",
          "FlaxMBartPreTrainedModel",
      ]


if TYPE_CHECKING:
      from .configuration_mbart import MBART_PRETRAINED_CONFIG_ARCHIVE_MAP, MBartConfig, MBartOnnxConfig

      try:
            if not is_sentencepiece_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_mbart import MBartTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_mbart_fast import MBartTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_mbart import (
                MBART_PRETRAINED_MODEL_ARCHIVE_LIST,
                MBartForCausalLM,
                MBartForConditionalGeneration,
                MBartForQuestionAnswering,
                MBartForSequenceClassification,
                MBartModel,
                MBartPreTrainedModel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_mbart import TFMBartForConditionalGeneration, TFMBartModel, TFMBartPreTrainedModel

      try:
            if not is_flax_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_flax_mbart import (
                FlaxMBartForConditionalGeneration,
                FlaxMBartForQuestionAnswering,
                FlaxMBartForSequenceClassification,
                FlaxMBartModel,
                FlaxMBartPreTrainedModel,
            )

else:
      import sys

      A:   Tuple								=		_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)


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


lowercase  :					List[Any]													=       logging.get_logger(__name__)

lowercase  :					Any													=       {
    'google/pegasus-large': 'https://huggingface.co/google/pegasus-large/resolve/main/config.json',
    # See all PEGASUS models at https://huggingface.co/models?filter=pegasus
}




class  lowerCamelCase__							(				__lowercase):




	'''simple docstring'''




	_A								=     'pegasus'
	_A								=     ['past_key_values']
	_A								=     {'num_attention_heads': 'encoder_attention_heads', 'hidden_size': 'd_model'}







	def __init__(					self		:Dict     ,   a		:Dict=5_0_2_6_5     ,   a		:Dict=1_0_2_4     ,   a		:Union[str, Any]=1_2     ,   a		:Any=4_0_9_6     ,   a		:str=1_6     ,   a		:str=1_2     ,   a		:Optional[Any]=4_0_9_6     ,   a		:int=1_6     ,   a		:Optional[int]=0.0     ,   a		:Optional[int]=0.0     ,   a		:List[Any]=True     ,   a		:Union[str, Any]=True     ,   a		:int="gelu"     ,   a		:Dict=1_0_2_4     ,   a		:List[Any]=0.1     ,   a		:List[str]=0.0     ,   a		:List[Any]=0.0     ,   a		:str=0.02     ,   a		:int=0     ,   a		:Any=False     ,   a		:Dict=0     ,   a		:int=1     ,   a		:Optional[Any]=1     ,   **a		:Optional[int]     ,   )		-> str:
								__UpperCamelCase	:   List[Any]			   =					vocab_size
								__UpperCamelCase	:   Union[str, Any]			   =					max_position_embeddings
								__UpperCamelCase	:   str			   =					d_model
								__UpperCamelCase	:   Dict			   =					encoder_ffn_dim
								__UpperCamelCase	:   int			   =					encoder_layers
								__UpperCamelCase	:   int			   =					encoder_attention_heads
								__UpperCamelCase	:   List[Any]			   =					decoder_ffn_dim
								__UpperCamelCase	:   List[Any]			   =					decoder_layers
								__UpperCamelCase	:   List[str]			   =					decoder_attention_heads
								__UpperCamelCase	:   str			   =					dropout
								__UpperCamelCase	:   Union[str, Any]			   =					attention_dropout
								__UpperCamelCase	:   List[str]			   =					activation_dropout
								__UpperCamelCase	:   Optional[Any]			   =					activation_function
								__UpperCamelCase	:   Tuple			   =					init_std
								__UpperCamelCase	:   Optional[int]			   =					encoder_layerdrop
								__UpperCamelCase	:   Union[str, Any]			   =					decoder_layerdrop
								__UpperCamelCase	:   Optional[Any]			   =					use_cache
								__UpperCamelCase	:   Union[str, Any]			   =					encoder_layers
								__UpperCamelCase	:   int			   =					scale_embedding  # scale factor will be sqrt(d_model) if True
								super().__init__(
								    pad_token_id=a     ,   eos_token_id=a     ,   is_encoder_decoder=a     ,   decoder_start_token_id=a     ,   forced_eos_token_id=a     ,   **a     ,   )







	@property
	def    _lowerCamelCase				(					self		:Dict						)		-> int:
								return self.encoder_attention_heads







	@property
	def    _lowerCamelCase				(					self		:Optional[Any]						)		-> int:
								return self.d_model