






from typing import Mapping

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


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

class        _SCREAMING_SNAKE_CASE			(     _a ):
	snake_case__				:	Optional[int]	      =    """mt5"""
	snake_case__				:	List[str]	      =    ["""past_key_values"""]





	def __init__(						self							:   int					,    __lowerCamelCase							:   Union[str, Any]=250_112					,    __lowerCamelCase							:   Any=512					,    __lowerCamelCase							:   List[str]=64					,    __lowerCamelCase							:   Tuple=1_024					,    __lowerCamelCase							:   Dict=8					,    __lowerCamelCase							:   int=None					,    __lowerCamelCase							:   List[str]=6					,    __lowerCamelCase							:   Tuple=32					,    __lowerCamelCase							:   List[Any]=128					,    __lowerCamelCase							:   Dict=0.1					,    __lowerCamelCase							:   int=1E-6					,    __lowerCamelCase							:   Dict=1.0					,    __lowerCamelCase							:   List[Any]="gated-gelu"					,    __lowerCamelCase							:   int=True					,    __lowerCamelCase							:   Dict=True					,    __lowerCamelCase							:   Dict="T5Tokenizer"					,    __lowerCamelCase							:   Optional[int]=False					,    __lowerCamelCase							:   Dict=0					,    __lowerCamelCase							:   Tuple=1					,    __lowerCamelCase							:   Tuple=0					,    **__lowerCamelCase							:   Optional[int]					,    ):
		super().__init__(
		    is_encoder_decoder=__lowerCamelCase					,    tokenizer_class=__lowerCamelCase					,    tie_word_embeddings=__lowerCamelCase					,    pad_token_id=__lowerCamelCase					,    eos_token_id=__lowerCamelCase					,    decoder_start_token_id=__lowerCamelCase					,    **__lowerCamelCase					,    )
		UpperCamelCase	:Any		=      vocab_size
		UpperCamelCase	:Any		=      d_model
		UpperCamelCase	:Tuple		=      d_kv
		UpperCamelCase	:int		=      d_ff
		UpperCamelCase	:Dict		=      num_layers
		UpperCamelCase	:Dict		=      (
		    num_decoder_layers if num_decoder_layers is not None else self.num_layers
		)  # default = symmetry
		UpperCamelCase	:int		=      num_heads
		UpperCamelCase	:Union[str, Any]		=      relative_attention_num_buckets
		UpperCamelCase	:List[str]		=      relative_attention_max_distance
		UpperCamelCase	:str		=      dropout_rate
		UpperCamelCase	:List[str]		=      layer_norm_epsilon
		UpperCamelCase	:Union[str, Any]		=      initializer_factor
		UpperCamelCase	:int		=      feed_forward_proj
		UpperCamelCase	:Tuple		=      use_cache

		UpperCamelCase	:str		=      self.feed_forward_proj.split("""-"""      )
		UpperCamelCase	:List[Any]		=      act_info[-1]
		UpperCamelCase	:Dict		=      act_info[0] == """gated"""

		if len(__lowerCamelCase      ) > 1 and act_info[0] != "gated" or len(__lowerCamelCase      ) > 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	:Union[str, Any]		=      """gelu_new"""





	@property
	def 		_A					(						self							:   Optional[int]      ):
		return self.d_model





	@property
	def 		_A					(						self							:   List[str]      ):
		return self.num_heads





	@property
	def 		_A					(						self							:   Dict      ):
		return self.num_layers

class        _SCREAMING_SNAKE_CASE			(     _a ):





	@property
	# Copied from transformers.models.t5.configuration_t5.T5OnnxConfig.inputs
	def 		_A					(						self							:   Optional[int]      ):
		UpperCamelCase	:int		=      {
		    """input_ids""": {0: """batch""", 1: """encoder_sequence"""},
		    """attention_mask""": {0: """batch""", 1: """encoder_sequence"""},
		}
		if self.use_past:
			UpperCamelCase	:List[str]		=      """past_encoder_sequence + sequence"""
			UpperCamelCase	:str		=      {0: """batch"""}
			UpperCamelCase	:int		=      {0: """batch""", 1: """past_decoder_sequence + sequence"""}
		else:
			UpperCamelCase	:str		=      {0: """batch""", 1: """decoder_sequence"""}
			UpperCamelCase	:Optional[int]		=      {0: """batch""", 1: """decoder_sequence"""}

		if self.use_past:
			self.fill_with_past_key_values_(__lowerCamelCase					,    direction="""inputs"""      )

		return common_inputs





	@property
	# Copied from transformers.models.t5.configuration_t5.T5OnnxConfig.default_onnx_opset
	def 		_A					(						self							:   Union[str, Any]      ):
		return 13





	@property
	def 		_A					(						self							:   Optional[int]      ):
		return 5E-4








from typing import TYPE_CHECKING

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


UpperCAmelCase_					:		int           = {
    '''configuration_unispeech_sat''': ['''UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''UniSpeechSatConfig'''],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	UpperCAmelCase_					:		Tuple           = [
	    '''UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST''',
	    '''UniSpeechSatForAudioFrameClassification''',
	    '''UniSpeechSatForCTC''',
	    '''UniSpeechSatForPreTraining''',
	    '''UniSpeechSatForSequenceClassification''',
	    '''UniSpeechSatForXVector''',
	    '''UniSpeechSatModel''',
	    '''UniSpeechSatPreTrainedModel''',
	]

if TYPE_CHECKING:
	from .configuration_unispeech_sat import UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechSatConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_unispeech_sat import (
		    UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    UniSpeechSatForAudioFrameClassification,
		    UniSpeechSatForCTC,
		    UniSpeechSatForPreTraining,
		    UniSpeechSatForSequenceClassification,
		    UniSpeechSatForXVector,
		    UniSpeechSatModel,
		    UniSpeechSatPreTrainedModel,
		)

else:
	import sys

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