
'''simple docstring'''


import functools
import operator

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


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

__lowercase							:   int					=     {
    '''microsoft/unispeech-sat-base-100h-libri-ft''': (
        '''https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft/resolve/main/config.json'''
    ),
    # See all UniSpeechSat models at https://huggingface.co/models?filter=unispeech_sat
}

class 	__lowercase				(  _lowercase    ):
			lowerCamelCase			:		Optional[int]	      =			"unispeech-sat"

			def __init__(self			,   A=3_2			,   A=7_6_8			,   A=1_2			,   A=1_2			,   A=3_0_7_2			,   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=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)			,   A=(5, 2, 2, 2, 2, 2, 2)			,   A=(1_0, 3, 3, 3, 3, 2, 2)			,   A=False			,   A=1_2_8			,   A=1_6			,   A=False			,   A=True			,   A=0.05			,   A=1_0			,   A=2			,   A=0.0			,   A=1_0			,   A=0			,   A=3_2_0			,   A=2			,   A=0.1			,   A=1_0_0			,   A=2_5_6			,   A=2_5_6			,   A=0.1			,   A="mean"			,   A=False			,   A=False			,   A=2_5_6			,   A=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)			,   A=(5, 3, 3, 1, 1)			,   A=(1, 2, 3, 1, 1)			,   A=5_1_2			,   A=0			,   A=1			,   A=2			,   A=5_0_4			,   **A			,   ):
								super().__init__(**A			,   pad_token_id=A			,   bos_token_id=A			,   eos_token_id=A      )
								lowerCamelCase_					:      List[Any]     =		hidden_size
								lowerCamelCase_					:      str     =		feat_extract_norm
								lowerCamelCase_					:      str     =		feat_extract_activation
								lowerCamelCase_					:      Optional[int]     =		list(A      )
								lowerCamelCase_					:      str     =		list(A      )
								lowerCamelCase_					:      List[str]     =		list(A      )
								lowerCamelCase_					:      int     =		conv_bias
								lowerCamelCase_					:      str     =		num_conv_pos_embeddings
								lowerCamelCase_					:      Any     =		num_conv_pos_embedding_groups
								lowerCamelCase_					:      Optional[Any]     =		len(self.conv_dim      )
								lowerCamelCase_					:      List[Any]     =		num_hidden_layers
								lowerCamelCase_					:      Tuple     =		intermediate_size
								lowerCamelCase_					:      Union[str, Any]     =		hidden_act
								lowerCamelCase_					:      List[Any]     =		num_attention_heads
								lowerCamelCase_					:      Optional[int]     =		hidden_dropout
								lowerCamelCase_					:      str     =		attention_dropout
								lowerCamelCase_					:      str     =		activation_dropout
								lowerCamelCase_					:      Any     =		feat_proj_dropout
								lowerCamelCase_					:      Optional[Any]     =		final_dropout
								lowerCamelCase_					:      int     =		layerdrop
								lowerCamelCase_					:      Dict     =		layer_norm_eps
								lowerCamelCase_					:      Dict     =		initializer_range
								lowerCamelCase_					:      Optional[Any]     =		vocab_size
								lowerCamelCase_					:      Any     =		num_clusters
								lowerCamelCase_					:      Any     =		do_stable_layer_norm
								lowerCamelCase_					:      Dict     =		use_weighted_layer_sum

								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
								lowerCamelCase_					:      Optional[Any]     =		apply_spec_augment
								lowerCamelCase_					:      Optional[int]     =		mask_time_prob
								lowerCamelCase_					:      List[str]     =		mask_time_length
								lowerCamelCase_					:      Optional[Any]     =		mask_time_min_masks
								lowerCamelCase_					:      Dict     =		mask_feature_prob
								lowerCamelCase_					:      Dict     =		mask_feature_length
								lowerCamelCase_					:      Dict     =		mask_feature_min_masks

								# parameters for pretraining with codevector quantized representations
								lowerCamelCase_					:      List[str]     =		num_codevectors_per_group
								lowerCamelCase_					:      List[str]     =		num_codevector_groups
								lowerCamelCase_					:      Optional[Any]     =		contrastive_logits_temperature
								lowerCamelCase_					:      str     =		feat_quantizer_dropout
								lowerCamelCase_					:      List[str]     =		num_negatives
								lowerCamelCase_					:      Dict     =		codevector_dim
								lowerCamelCase_					:      Dict     =		proj_codevector_dim
								lowerCamelCase_					:      List[str]     =		diversity_loss_weight

								# ctc loss
								lowerCamelCase_					:      List[str]     =		ctc_loss_reduction
								lowerCamelCase_					:      Any     =		ctc_zero_infinity

								# SequenceClassification-specific parameter. Feel free to ignore for other classes.
								lowerCamelCase_					:      List[str]     =		classifier_proj_size

								# XVector-specific parameters. Feel free to ignore for other classes.
								lowerCamelCase_					:      Optional[Any]     =		list(A      )
								lowerCamelCase_					:      Any     =		list(A      )
								lowerCamelCase_					:      Optional[int]     =		list(A      )
								lowerCamelCase_					:      int     =		xvector_output_dim






			@property
			def        UpperCAmelCase__ (self      ):
								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							:   str					=     {
    '''configuration_mctct''': ['''MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MCTCTConfig'''],
    '''feature_extraction_mctct''': ['''MCTCTFeatureExtractor'''],
    '''processing_mctct''': ['''MCTCTProcessor'''],
}


try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowercase							:   str					=     [
					    '''MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''MCTCTForCTC''',
					    '''MCTCTModel''',
					    '''MCTCTPreTrainedModel''',
					]


if TYPE_CHECKING:
					from .configuration_mctct import MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP, MCTCTConfig
					from .feature_extraction_mctct import MCTCTFeatureExtractor
					from .processing_mctct import MCTCTProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_mctct import MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST, MCTCTForCTC, MCTCTModel, MCTCTPreTrainedModel

else:
					import sys

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


