






"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCamelCase_							      = logging.get_logger(__name__)

lowerCamelCase_							      = {
    '''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_			(SCREAMING_SNAKE_CASE_	):
	__magic_name__       =							"pegasus"
	__magic_name__       =							["past_key_values"]
	__magic_name__       =							{"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}





	def __init__( self   :					List[Any]      ,      lowerCAmelCase_   :					List[str]=50_265      ,      lowerCAmelCase_   :					Dict=1_024      ,      lowerCAmelCase_   :					Tuple=12      ,      lowerCAmelCase_   :					Optional[Any]=4_096      ,      lowerCAmelCase_   :					List[Any]=16      ,      lowerCAmelCase_   :					List[Any]=12      ,      lowerCAmelCase_   :					str=4_096      ,      lowerCAmelCase_   :					Any=16      ,      lowerCAmelCase_   :					str=0.0      ,      lowerCAmelCase_   :					Optional[int]=0.0      ,      lowerCAmelCase_   :					Optional[int]=True      ,      lowerCAmelCase_   :					int=True      ,      lowerCAmelCase_   :					Tuple="gelu"      ,      lowerCAmelCase_   :					Any=1_024      ,      lowerCAmelCase_   :					Dict=0.1      ,      lowerCAmelCase_   :					Tuple=0.0      ,      lowerCAmelCase_   :					Any=0.0      ,      lowerCAmelCase_   :					Tuple=0.0_2      ,      lowerCAmelCase_   :					Any=0      ,      lowerCAmelCase_   :					Dict=False      ,      lowerCAmelCase_   :					Union[str, Any]=0      ,      lowerCAmelCase_   :					int=1      ,      lowerCAmelCase_   :					Union[str, Any]=1      ,      **lowerCAmelCase_   :					Tuple      ,      )		->     Tuple:
				UpperCAmelCase_	:					List[str]     	=   vocab_size
				UpperCAmelCase_	:					Optional[Any]     	=   max_position_embeddings
				UpperCAmelCase_	:					Optional[Any]     	=   d_model
				UpperCAmelCase_	:					str     	=   encoder_ffn_dim
				UpperCAmelCase_	:					Optional[int]     	=   encoder_layers
				UpperCAmelCase_	:					str     	=   encoder_attention_heads
				UpperCAmelCase_	:					Dict     	=   decoder_ffn_dim
				UpperCAmelCase_	:					Dict     	=   decoder_layers
				UpperCAmelCase_	:					Optional[Any]     	=   decoder_attention_heads
				UpperCAmelCase_	:					Dict     	=   dropout
				UpperCAmelCase_	:					Optional[Any]     	=   attention_dropout
				UpperCAmelCase_	:					Optional[Any]     	=   activation_dropout
				UpperCAmelCase_	:					Any     	=   activation_function
				UpperCAmelCase_	:					Tuple     	=   init_std
				UpperCAmelCase_	:					List[str]     	=   encoder_layerdrop
				UpperCAmelCase_	:					int     	=   decoder_layerdrop
				UpperCAmelCase_	:					List[str]     	=   use_cache
				UpperCAmelCase_	:					Optional[int]     	=   encoder_layers
				UpperCAmelCase_	:					Tuple     	=   scale_embedding  # scale factor will be sqrt(d_model) if True
				super().__init__(
				    pad_token_id=lowercase_      ,      eos_token_id=lowercase_      ,      is_encoder_decoder=lowercase_      ,      decoder_start_token_id=lowercase_      ,      forced_eos_token_id=lowercase_      ,      **lowercase_      ,      )





	@property
	def 	_SCREAMING_SNAKE_CASE ( self   :					Tuple		)		->     int:
				return self.encoder_attention_heads





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





"""simple docstring"""

from typing import TYPE_CHECKING

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


SCREAMING_SNAKE_CASE_            =    {
    '''configuration_speecht5''': [
        '''SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP''',
        '''SpeechT5Config''',
        '''SpeechT5HifiGanConfig''',
    ],
    '''feature_extraction_speecht5''': ['''SpeechT5FeatureExtractor'''],
    '''processing_speecht5''': ['''SpeechT5Processor'''],
}

try:
   if not is_sentencepiece_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   SCREAMING_SNAKE_CASE_            =    ['''SpeechT5Tokenizer''']

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   SCREAMING_SNAKE_CASE_            =    [
       '''SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''SpeechT5ForSpeechToText''',
       '''SpeechT5ForSpeechToSpeech''',
       '''SpeechT5ForTextToSpeech''',
       '''SpeechT5Model''',
       '''SpeechT5PreTrainedModel''',
       '''SpeechT5HifiGan''',
   ]

if TYPE_CHECKING:
   from .configuration_speechta import (
       SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP,
       SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP,
       SpeechTaConfig,
       SpeechTaHifiGanConfig,
   )
   from .feature_extraction_speechta import SpeechTaFeatureExtractor
   from .processing_speechta import SpeechTaProcessor

   try:
      if not is_sentencepiece_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_speechta import SpeechTaTokenizer

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_speechta import (
          SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST,
          SpeechTaForSpeechToSpeech,
          SpeechTaForSpeechToText,
          SpeechTaForTextToSpeech,
          SpeechTaHifiGan,
          SpeechTaModel,
          SpeechTaPreTrainedModel,
      )

else:
   import sys

   SCREAMING_SNAKE_CASE_            =    _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



