






import functools
import operator

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


a_		:    List[str]   							=     logging.get_logger(__name__)

a_		:    Any   							=     {
    'microsoft/unispeech-large-1500h-cv': (
        'https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json'
    ),
    # See all UniSpeech models at https://huggingface.co/models?filter=unispeech
}

class 		_snake_case	(	A__       ):
			_lowercase		:     Optional[int]        =				'''unispeech'''






			def __init__(							self		,       a=32		,       a=768		,       a=12		,       a=12		,       a=3072		,       a="gelu"		,       a=0.1		,       a=0.1		,       a=0.1		,       a=0.0		,       a=0.0		,       a=0.1		,       a=0.1		,       a=0.02		,       a=1E-5		,       a="group"		,       a="gelu"		,       a=(512, 512, 512, 512, 512, 512, 512)		,       a=(5, 2, 2, 2, 2, 2, 2)		,       a=(10, 3, 3, 3, 3, 2, 2)		,       a=False		,       a=128		,       a=16		,       a=False		,       a=True		,       a=0.05		,       a=10		,       a=2		,       a=0.0		,       a=10		,       a=0		,       a=320		,       a=2		,       a=0.1		,       a=100		,       a=256		,       a=256		,       a=0.1		,       a="mean"		,       a=False		,       a=False		,       a=256		,       a=80		,       a=0		,       a=1		,       a=2		,       a=0.5		,       **a		,       )   ->							Optional[int]:
						super().__init__(**a		,       pad_token_id=a		,       bos_token_id=a		,       eos_token_id=a)
						SCREAMING_SNAKE_CASE							=			hidden_size
						SCREAMING_SNAKE_CASE							=			feat_extract_norm
						SCREAMING_SNAKE_CASE							=			feat_extract_activation
						SCREAMING_SNAKE_CASE							=			list(a)
						SCREAMING_SNAKE_CASE							=			list(a)
						SCREAMING_SNAKE_CASE							=			list(a)
						SCREAMING_SNAKE_CASE							=			conv_bias
						SCREAMING_SNAKE_CASE							=			num_conv_pos_embeddings
						SCREAMING_SNAKE_CASE							=			num_conv_pos_embedding_groups
						SCREAMING_SNAKE_CASE							=			len(self.conv_dim)
						SCREAMING_SNAKE_CASE							=			num_hidden_layers
						SCREAMING_SNAKE_CASE							=			intermediate_size
						SCREAMING_SNAKE_CASE							=			hidden_act
						SCREAMING_SNAKE_CASE							=			num_attention_heads
						SCREAMING_SNAKE_CASE							=			hidden_dropout
						SCREAMING_SNAKE_CASE							=			attention_dropout
						SCREAMING_SNAKE_CASE							=			activation_dropout
						SCREAMING_SNAKE_CASE							=			feat_proj_dropout
						SCREAMING_SNAKE_CASE							=			final_dropout
						SCREAMING_SNAKE_CASE							=			layerdrop
						SCREAMING_SNAKE_CASE							=			layer_norm_eps
						SCREAMING_SNAKE_CASE							=			initializer_range
						SCREAMING_SNAKE_CASE							=			num_ctc_classes
						SCREAMING_SNAKE_CASE							=			vocab_size
						SCREAMING_SNAKE_CASE							=			do_stable_layer_norm
						SCREAMING_SNAKE_CASE							=			use_weighted_layer_sum
						SCREAMING_SNAKE_CASE							=			classifier_proj_size

						if (
						    (len(self.conv_stride) != self.num_feat_extract_layers)
						    or (len(self.conv_kernel) != self.num_feat_extract_layers)
						    or (len(self.conv_dim) != self.num_feat_extract_layers)
						):
									raise ValueError(
									    'Configuration for convolutional layers is incorrect. It is required that `len(config.conv_dim)` =='
									    ' `len(config.conv_stride)` == `len(config.conv_kernel)`, but is `len(config.conv_dim) ='
									    f''' {len(self.conv_dim)}`, `len(config.conv_stride) = {len(self.conv_stride)}`,'''
									    f''' `len(config.conv_kernel) = {len(self.conv_kernel)}`.''')

						# fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
						SCREAMING_SNAKE_CASE							=			apply_spec_augment
						SCREAMING_SNAKE_CASE							=			mask_time_prob
						SCREAMING_SNAKE_CASE							=			mask_time_length
						SCREAMING_SNAKE_CASE							=			mask_time_min_masks
						SCREAMING_SNAKE_CASE							=			mask_feature_prob
						SCREAMING_SNAKE_CASE							=			mask_feature_length
						SCREAMING_SNAKE_CASE							=			mask_feature_min_masks

						# parameters for pretraining with codevector quantized representations
						SCREAMING_SNAKE_CASE							=			num_codevectors_per_group
						SCREAMING_SNAKE_CASE							=			num_codevector_groups
						SCREAMING_SNAKE_CASE							=			contrastive_logits_temperature
						SCREAMING_SNAKE_CASE							=			feat_quantizer_dropout
						SCREAMING_SNAKE_CASE							=			num_negatives
						SCREAMING_SNAKE_CASE							=			codevector_dim
						SCREAMING_SNAKE_CASE							=			proj_codevector_dim
						SCREAMING_SNAKE_CASE							=			diversity_loss_weight

						# ctc loss
						SCREAMING_SNAKE_CASE							=			ctc_loss_reduction
						SCREAMING_SNAKE_CASE							=			ctc_zero_infinity

						# pretraining loss
						SCREAMING_SNAKE_CASE							=			replace_prob







			@property
			def  SCREAMING_SNAKE_CASE__     (							self)   ->							Tuple:
						return functools.reduce(operator.mul		,       self.conv_stride		,       1)










'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowercase  =			{
    """configuration_pegasus_x""": ["""PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP""", """PegasusXConfig"""],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_lowercase  =			[
	    """PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """PegasusXForConditionalGeneration""",
	    """PegasusXModel""",
	    """PegasusXPreTrainedModel""",
	]


if TYPE_CHECKING:
	from .configuration_pegasus_x import PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusXConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_pegasus_x import (
		    PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST,
		    PegasusXForConditionalGeneration,
		    PegasusXModel,
		    PegasusXPreTrainedModel,
		)


else:
	import sys

	_lowercase  =			_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

