




'''simple docstring'''







from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxSeqaSeqConfigWithPast
from ...utils import logging


A					       =logging.get_logger(__name__)


class      _a    (      __a					):
       __a							:	Optional[Any]  							=   """mt5"""
       __a							:	Union[str, Any]  							=   ["""past_key_values"""]
       def __init__(      self		:      Optional[int]  ,							lowercase		:      str=250_112  ,							lowercase		:      Union[str, Any]=512  ,							lowercase		:      Any=64  ,							lowercase		:      Tuple=1_024  ,							lowercase		:      List[str]=8  ,							lowercase		:      List[str]=None  ,							lowercase		:      Dict=6  ,							lowercase		:      str=32  ,							lowercase		:      Optional[Any]=128  ,							lowercase		:      Any=0.1  ,							lowercase		:      int=1E-6  ,							lowercase		:      int=1.0  ,							lowercase		:      List[Any]="gated-gelu"  ,							lowercase		:      Dict=True  ,							lowercase		:      str=True  ,							lowercase		:      str="T5Tokenizer"  ,							lowercase		:      Dict=False  ,							lowercase		:      Tuple=0  ,							lowercase		:      List[Any]=1  ,							lowercase		:      str=0  ,							**lowercase		:      Dict  ,							):



           '''simple docstring'''

           super().__init__(
               is_encoder_decoder=lowercase  ,							tokenizer_class=lowercase  ,							tie_word_embeddings=lowercase  ,							pad_token_id=lowercase  ,							eos_token_id=lowercase  ,							decoder_start_token_id=lowercase  ,							**lowercase  ,							)
           UpperCAmelCase     			=						vocab_size
           UpperCAmelCase     			=						d_model
           UpperCAmelCase     			=						d_kv
           UpperCAmelCase     			=						d_ff
           UpperCAmelCase     			=						num_layers
           UpperCAmelCase     			=						(
               num_decoder_layers if num_decoder_layers is not None else self.num_layers
           )  # default = symmetry
           UpperCAmelCase     			=						num_heads
           UpperCAmelCase     			=						relative_attention_num_buckets
           UpperCAmelCase     			=						relative_attention_max_distance
           UpperCAmelCase     			=						dropout_rate
           UpperCAmelCase     			=						layer_norm_epsilon
           UpperCAmelCase     			=						initializer_factor
           UpperCAmelCase     			=						feed_forward_proj
           UpperCAmelCase     			=						use_cache

           UpperCAmelCase     			=						self.feed_forward_proj.split('''-'''							)
           UpperCAmelCase     			=						act_info[-1]
           UpperCAmelCase     			=						act_info[0] == '''gated'''

           if len(lowercase							) > 1 and act_info[0] != "gated" or len(lowercase							) > 2:
               raise ValueError(
                   f"`feed_forward_proj`: {feed_forward_proj} is not a valid activation function of the dense layer."
                   '''Please make sure `feed_forward_proj` is of the format `gated-{ACT_FN}` or `{ACT_FN}`, e.g. '''
                   '''\'gated-gelu\' or \'relu\''''							)

           # for backwards compatibility
           if feed_forward_proj == "gated-gelu":
               UpperCAmelCase     			=						'''gelu_new'''
       @property
       def        A (      self		:      Any							):



           '''simple docstring'''

           return self.d_model
       @property
       def        A (      self		:      str							):



           '''simple docstring'''

           return self.num_heads







       @property
       def        A (      self		:      Optional[int]							):



           '''simple docstring'''

           return self.num_layers






class      _a    (      __a					):
       @property
       # Copied from transformers.models.t5.configuration_t5.T5OnnxConfig.inputs
       def        A (      self		:      Optional[int]							):



           '''simple docstring'''

           UpperCAmelCase     			=						{
               '''input_ids''': {0: '''batch''', 1: '''encoder_sequence'''},
               '''attention_mask''': {0: '''batch''', 1: '''encoder_sequence'''},
           }
           if self.use_past:
               UpperCAmelCase     			=						'''past_encoder_sequence + sequence'''
               UpperCAmelCase     			=						{0: '''batch'''}
               UpperCAmelCase     			=						{0: '''batch''', 1: '''past_decoder_sequence + sequence'''}
           else:
               UpperCAmelCase     			=						{0: '''batch''', 1: '''decoder_sequence'''}
               UpperCAmelCase     			=						{0: '''batch''', 1: '''decoder_sequence'''}

           if self.use_past:
               self.fill_with_past_key_values_(lowercase  ,							direction='''inputs'''							)

           return common_inputs
       @property
       # Copied from transformers.models.t5.configuration_t5.T5OnnxConfig.default_onnx_opset
       def        A (      self		:      List[str]							):



           '''simple docstring'''

           return 13







       @property
       def        A (      self		:      int							):



           '''simple docstring'''

           return 5E-4










'''simple docstring'''







from ..utils import DummyObject, requires_backends


class      _a    (      metaclass=__a					):
       __a							:	str  							=   ["""torch""", """librosa"""]
       def __init__(      self		:      int  ,							*lowercase		:      Any  ,							**lowercase		:      Optional[int]							):



           '''simple docstring'''

           requires_backends(self  ,							['''torch''', '''librosa''']							)
       @classmethod
       def        A (      cls		:      Optional[int]  ,							*lowercase		:      List[str]  ,							**lowercase		:      str							):



           '''simple docstring'''

           requires_backends(cls  ,							['''torch''', '''librosa''']							)







       @classmethod
       def        A (      cls		:      Dict  ,							*lowercase		:      Optional[int]  ,							**lowercase		:      List[Any]							):



           '''simple docstring'''

           requires_backends(cls  ,							['''torch''', '''librosa''']							)






class      _a    (      metaclass=__a					):
       __a							:	List[Any]  							=   ["""torch""", """librosa"""]
       def __init__(      self		:      int  ,							*lowercase		:      Optional[int]  ,							**lowercase		:      Optional[int]							):



           '''simple docstring'''

           requires_backends(self  ,							['''torch''', '''librosa''']							)
       @classmethod
       def        A (      cls		:      Dict  ,							*lowercase		:      Tuple  ,							**lowercase		:      List[str]							):



           '''simple docstring'''

           requires_backends(cls  ,							['''torch''', '''librosa''']							)







       @classmethod
       def        A (      cls		:      Any  ,							*lowercase		:      Any  ,							**lowercase		:      Tuple							):



           '''simple docstring'''

           requires_backends(cls  ,							['''torch''', '''librosa''']							)




