

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


UpperCAmelCase__	:       Tuple			      =      logging.get_logger(__name__)

UpperCAmelCase__	:       str			      =      {
    "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     a__    (				A__    ):







  """simple docstring"""




  UpperCAmelCase__ :	Optional[Any]         ="""pegasus_x"""
  UpperCAmelCase__ :	Tuple         =["""past_key_values"""]
  UpperCAmelCase__ :	Tuple         ={"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}


  def __init__(     self      :	Dict			,			UpperCAmelCase__      :	List[Any]=9_6_1_0_3			,			UpperCAmelCase__      :	int=1_6_3_8_4			,			UpperCAmelCase__      :	Tuple=1_6			,			UpperCAmelCase__      :	Any=4_0_9_6			,			UpperCAmelCase__      :	List[str]=1_6			,			UpperCAmelCase__      :	Dict=1_6			,			UpperCAmelCase__      :	Union[str, Any]=4_0_9_6			,			UpperCAmelCase__      :	Optional[Any]=1_6			,			UpperCAmelCase__      :	Any=0.0			,			UpperCAmelCase__      :	List[str]=0.0			,			UpperCAmelCase__      :	Any=True			,			UpperCAmelCase__      :	Union[str, Any]=True			,			UpperCAmelCase__      :	int="gelu"			,			UpperCAmelCase__      :	Dict=1_0_2_4			,			UpperCAmelCase__      :	Union[str, Any]=0.1			,			UpperCAmelCase__      :	Optional[Any]=0.0			,			UpperCAmelCase__      :	int=0.0			,			UpperCAmelCase__      :	int=0.02			,			UpperCAmelCase__      :	int=0			,			UpperCAmelCase__      :	int=True			,			UpperCAmelCase__      :	Optional[int]=0			,			UpperCAmelCase__      :	Union[str, Any]=1			,			UpperCAmelCase__      :	Union[str, Any]=1			,			UpperCAmelCase__      :	Optional[Any]=3_2			,			UpperCAmelCase__      :	Any=5_1_2			,			UpperCAmelCase__      :	List[Any]=True			,			**UpperCAmelCase__      :	List[Any]			,			)   ->Dict:
        """simple docstring"""







        SCREAMING_SNAKE_CASE	: int					       =				vocab_size
        SCREAMING_SNAKE_CASE	: Union[str, Any]					       =				max_position_embeddings
        SCREAMING_SNAKE_CASE	: Union[str, Any]					       =				d_model
        SCREAMING_SNAKE_CASE	: Union[str, Any]					       =				encoder_ffn_dim
        SCREAMING_SNAKE_CASE	: Tuple					       =				encoder_layers
        SCREAMING_SNAKE_CASE	: List[Any]					       =				encoder_attention_heads
        SCREAMING_SNAKE_CASE	: Tuple					       =				decoder_ffn_dim
        SCREAMING_SNAKE_CASE	: str					       =				decoder_layers
        SCREAMING_SNAKE_CASE	: List[str]					       =				decoder_attention_heads
        SCREAMING_SNAKE_CASE	: int					       =				dropout
        SCREAMING_SNAKE_CASE	: Union[str, Any]					       =				attention_dropout
        SCREAMING_SNAKE_CASE	: Dict					       =				activation_dropout
        SCREAMING_SNAKE_CASE	: Optional[int]					       =				activation_function
        SCREAMING_SNAKE_CASE	: Dict					       =				init_std
        SCREAMING_SNAKE_CASE	: List[str]					       =				encoder_layerdrop
        SCREAMING_SNAKE_CASE	: Optional[Any]					       =				decoder_layerdrop
        SCREAMING_SNAKE_CASE	: List[Any]					       =				use_cache
        SCREAMING_SNAKE_CASE	: str					       =				encoder_layers
        SCREAMING_SNAKE_CASE	: Tuple					       =				scale_embedding  # scale factor will be sqrt(d_model) if True

        SCREAMING_SNAKE_CASE	: List[Any]					       =				num_global_tokens
        SCREAMING_SNAKE_CASE	: Optional[Any]					       =				block_size
        SCREAMING_SNAKE_CASE	: str					       =				stagger_local_blocks

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


  @property
  def 	_lowercase (     self      :	int						)   ->int:
        """simple docstring"""







        return self.encoder_attention_heads




  @property
  def 	_lowercase (     self      :	Union[str, Any]						)   ->int:
        """simple docstring"""







        return self.d_model







from typing import TYPE_CHECKING

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


UpperCAmelCase__	:       int			      =      {
    """configuration_speech_to_text_2""": ["""SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP""", """Speech2Text2Config"""],
    """processing_speech_to_text_2""": ["""Speech2Text2Processor"""],
    """tokenization_speech_to_text_2""": ["""Speech2Text2Tokenizer"""],
}


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase__	:       int			      =      [
      """SPEECH_TO_TEXT_2_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """Speech2Text2ForCausalLM""",
      """Speech2Text2PreTrainedModel""",
  ]


if TYPE_CHECKING:
  from .configuration_speech_to_text_a import SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP, SpeechaTextaConfig
  from .processing_speech_to_text_a import SpeechaTextaProcessor
  from .tokenization_speech_to_text_a import SpeechaTextaTokenizer

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_speech_to_text_a import (
        SPEECH_TO_TEXT_2_PRETRAINED_MODEL_ARCHIVE_LIST,
        SpeechaTextaForCausalLM,
        SpeechaTextaPreTrainedModel,
    )

else:
  import sys

  UpperCAmelCase__	:       int			      =      _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)




