





from typing import TYPE_CHECKING

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


_snake_case  :    Tuple						    =  {
    'configuration_gpt_bigcode': ['GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP', 'GPTBigCodeConfig'],
}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _snake_case  :    Optional[int]						    =  [
         'GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST',
         'GPTBigCodeForSequenceClassification',
         'GPTBigCodeForTokenClassification',
         'GPTBigCodeForCausalLM',
         'GPTBigCodeModel',
         'GPTBigCodePreTrainedModel',
     ]

if TYPE_CHECKING:
     from .configuration_gpt_bigcode import GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTBigCodeConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_gpt_bigcode import (
              GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST,
              GPTBigCodeForCausalLM,
              GPTBigCodeForSequenceClassification,
              GPTBigCodeForTokenClassification,
              GPTBigCodeModel,
              GPTBigCodePreTrainedModel,
          )


else:
     import sys

     _snake_case  :    Optional[int]						    =  _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)








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


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

_snake_case  :    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 				_UpperCAmelCase    (    _UpperCamelCase    ):

  """simple docstring"""


  a_        = """pegasus"""
  a_        = ["""past_key_values"""]
  a_        = {"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}






  def __init__(				self :		List[str]					,  lowerCAmelCase_ :		Union[str, Any]=5_0_2_6_5					,  lowerCAmelCase_ :		Union[str, Any]=1_0_2_4					,  lowerCAmelCase_ :		Union[str, Any]=1_2					,  lowerCAmelCase_ :		Dict=4_0_9_6					,  lowerCAmelCase_ :		str=1_6					,  lowerCAmelCase_ :		List[Any]=1_2					,  lowerCAmelCase_ :		Union[str, Any]=4_0_9_6					,  lowerCAmelCase_ :		Union[str, Any]=1_6					,  lowerCAmelCase_ :		Any=0.0					,  lowerCAmelCase_ :		Optional[int]=0.0					,  lowerCAmelCase_ :		List[Any]=True					,  lowerCAmelCase_ :		Any=True					,  lowerCAmelCase_ :		Dict="gelu"					,  lowerCAmelCase_ :		Optional[int]=1_0_2_4					,  lowerCAmelCase_ :		List[str]=0.1					,  lowerCAmelCase_ :		str=0.0					,  lowerCAmelCase_ :		Union[str, Any]=0.0					,  lowerCAmelCase_ :		Optional[int]=0.02					,  lowerCAmelCase_ :		Tuple=0					,  lowerCAmelCase_ :		Tuple=False					,  lowerCAmelCase_ :		Union[str, Any]=0					,  lowerCAmelCase_ :		int=1					,  lowerCAmelCase_ :		Tuple=1					,  **lowerCAmelCase_ :		Tuple					,  )							->						List[str]:
     __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
     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 				lowercase		(				self :		List[Any]     )							->						int:
     return self.encoder_attention_heads






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

