






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


A_	:	Any				=				logging.get_logger(__name__)

A_	:	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( UpperCAmelCase_      ):





       """simple docstring"""







       a       :	str								='''pegasus_x'''
       a       :	int								=['''past_key_values''']
       a       :	str								={'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}





       def __init__(      self						,    _lowerCamelCase=9_6_1_0_3						,    _lowerCamelCase=1_6_3_8_4						,    _lowerCamelCase=1_6						,    _lowerCamelCase=4_0_9_6						,    _lowerCamelCase=1_6						,    _lowerCamelCase=1_6						,    _lowerCamelCase=4_0_9_6						,    _lowerCamelCase=1_6						,    _lowerCamelCase=0.0						,    _lowerCamelCase=0.0						,    _lowerCamelCase=True						,    _lowerCamelCase=True						,    _lowerCamelCase="gelu"						,    _lowerCamelCase=1_0_2_4						,    _lowerCamelCase=0.1						,    _lowerCamelCase=0.0						,    _lowerCamelCase=0.0						,    _lowerCamelCase=0.0_2						,    _lowerCamelCase=0						,    _lowerCamelCase=True						,    _lowerCamelCase=0						,    _lowerCamelCase=1						,    _lowerCamelCase=1						,    _lowerCamelCase=3_2						,    _lowerCamelCase=5_1_2						,    _lowerCamelCase=True						,    **_lowerCamelCase						,    ):
         UpperCamelCase_:      Tuple					   =       vocab_size
         UpperCamelCase_:      Any					   =       max_position_embeddings
         UpperCamelCase_:      List[str]					   =       d_model
         UpperCamelCase_:      Tuple					   =       encoder_ffn_dim
         UpperCamelCase_:      List[Any]					   =       encoder_layers
         UpperCamelCase_:      Optional[Any]					   =       encoder_attention_heads
         UpperCamelCase_:      List[Any]					   =       decoder_ffn_dim
         UpperCamelCase_:      Optional[Any]					   =       decoder_layers
         UpperCamelCase_:      List[str]					   =       decoder_attention_heads
         UpperCamelCase_:      Optional[int]					   =       dropout
         UpperCamelCase_:      int					   =       attention_dropout
         UpperCamelCase_:      List[Any]					   =       activation_dropout
         UpperCamelCase_:      Any					   =       activation_function
         UpperCamelCase_:      Optional[Any]					   =       init_std
         UpperCamelCase_:      Union[str, Any]					   =       encoder_layerdrop
         UpperCamelCase_:      Any					   =       decoder_layerdrop
         UpperCamelCase_:      Optional[Any]					   =       use_cache
         UpperCamelCase_:      Optional[int]					   =       encoder_layers
         UpperCamelCase_:      List[Any]					   =       scale_embedding  # scale factor will be sqrt(d_model) if True

         UpperCamelCase_:      Tuple					   =       num_global_tokens
         UpperCamelCase_:      Dict					   =       block_size
         UpperCamelCase_:      str					   =       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							):
         return self.encoder_attention_heads





       @property
       def     _a					(      self							):
         return self.d_model







from typing import TYPE_CHECKING

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


A_	:	List[Any]				=				{
    'configuration_openai': ['OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'OpenAIGPTConfig'],
    'tokenization_openai': ['OpenAIGPTTokenizer'],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_	:	List[str]				=				['OpenAIGPTTokenizerFast']

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_	:	Any				=				[
       'OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST',
       'OpenAIGPTDoubleHeadsModel',
       'OpenAIGPTForSequenceClassification',
       'OpenAIGPTLMHeadModel',
       'OpenAIGPTModel',
       'OpenAIGPTPreTrainedModel',
       'load_tf_weights_in_openai_gpt',
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_	:	str				=				[
       'TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST',
       'TFOpenAIGPTDoubleHeadsModel',
       'TFOpenAIGPTForSequenceClassification',
       'TFOpenAIGPTLMHeadModel',
       'TFOpenAIGPTMainLayer',
       'TFOpenAIGPTModel',
       'TFOpenAIGPTPreTrainedModel',
   ]


if TYPE_CHECKING:
   from .configuration_openai import OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenAIGPTConfig
   from .tokenization_openai import OpenAIGPTTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_openai_fast import OpenAIGPTTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_openai import (
          OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST,
          OpenAIGPTDoubleHeadsModel,
          OpenAIGPTForSequenceClassification,
          OpenAIGPTLMHeadModel,
          OpenAIGPTModel,
          OpenAIGPTPreTrainedModel,
          load_tf_weights_in_openai_gpt,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_openai import (
          TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFOpenAIGPTDoubleHeadsModel,
          TFOpenAIGPTForSequenceClassification,
          TFOpenAIGPTLMHeadModel,
          TFOpenAIGPTMainLayer,
          TFOpenAIGPTModel,
          TFOpenAIGPTPreTrainedModel,
      )

else:
   import sys

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