




"""simple docstring"""

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


a							      =     logging.get_logger(__name__)

a							      =     {
    '''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 							lowercase_			(	__lowerCAmelCase				):



 '''simple docstring'''
 UpperCAmelCase       :	Dict     =      '''pegasus'''
 UpperCAmelCase       :	Any     =      ['''past_key_values''']
 UpperCAmelCase       :	Tuple     =      {'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}

 def __init__(					self			:			Optional[Any]       ,				_UpperCAmelCase			:			List[Any]=50_265       ,				_UpperCAmelCase			:			Optional[int]=1_024       ,				_UpperCAmelCase			:			Any=12       ,				_UpperCAmelCase			:			Optional[Any]=4_096       ,				_UpperCAmelCase			:			str=16       ,				_UpperCAmelCase			:			Any=12       ,				_UpperCAmelCase			:			List[str]=4_096       ,				_UpperCAmelCase			:			Any=16       ,				_UpperCAmelCase			:			Any=0.0       ,				_UpperCAmelCase			:			Optional[Any]=0.0       ,				_UpperCAmelCase			:			Union[str, Any]=True       ,				_UpperCAmelCase			:			Union[str, Any]=True       ,				_UpperCAmelCase			:			Optional[Any]="gelu"       ,				_UpperCAmelCase			:			Any=1_024       ,				_UpperCAmelCase			:			List[str]=0.1       ,				_UpperCAmelCase			:			int=0.0       ,				_UpperCAmelCase			:			List[Any]=0.0       ,				_UpperCAmelCase			:			Optional[Any]=0.02       ,				_UpperCAmelCase			:			Tuple=0       ,				_UpperCAmelCase			:			Optional[Any]=False       ,				_UpperCAmelCase			:			Union[str, Any]=0       ,				_UpperCAmelCase			:			Any=1       ,				_UpperCAmelCase			:			Tuple=1       ,				**_UpperCAmelCase			:			str       ,				):
       _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
       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      lowerCAmelCase_				(					self			:			Optional[int]						):
       return self.encoder_attention_heads



 @property
 def      lowerCAmelCase_				(					self			:			Optional[int]						):
       return self.d_model









"""simple docstring"""



from typing import TYPE_CHECKING

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


_lowerCAmelCase	:	Tuple				=      {
    """configuration_lxmert""": ["""LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LxmertConfig"""],
    """tokenization_lxmert""": ["""LxmertTokenizer"""],
}

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _lowerCAmelCase	:	int				=      ["""LxmertTokenizerFast"""]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _lowerCAmelCase	:	Tuple				=      [
     """LxmertEncoder""",
     """LxmertForPreTraining""",
     """LxmertForQuestionAnswering""",
     """LxmertModel""",
     """LxmertPreTrainedModel""",
     """LxmertVisualFeatureEncoder""",
     """LxmertXLayer""",
 ]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _lowerCAmelCase	:	Optional[int]				=      [
     """TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """TFLxmertForPreTraining""",
     """TFLxmertMainLayer""",
     """TFLxmertModel""",
     """TFLxmertPreTrainedModel""",
     """TFLxmertVisualFeatureEncoder""",
 ]


if TYPE_CHECKING:
 from .configuration_lxmert import LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP, LxmertConfig
 from .tokenization_lxmert import LxmertTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_lxmert_fast import LxmertTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_lxmert import (
      LxmertEncoder,
      LxmertForPreTraining,
      LxmertForQuestionAnswering,
      LxmertModel,
      LxmertPreTrainedModel,
      LxmertVisualFeatureEncoder,
      LxmertXLayer,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_lxmert import (
      TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFLxmertForPreTraining,
      TFLxmertMainLayer,
      TFLxmertModel,
      TFLxmertPreTrainedModel,
      TFLxmertVisualFeatureEncoder,
  )

else:
 import sys

 _lowerCAmelCase	:	Any				=      _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


