


"""simple docstring"""







import functools
import operator

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


a__    :							Any            =					logging.get_logger(__name__)

a__    :							Optional[Any]            =					{
    '''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 			UpperCamelCase_     (			a_):

	"""simple docstring"""





	snake_case__    :  Any    =      "unispeech-sat"




	def __init__(			self      :    Optional[int]      ,      UpperCAmelCase__      :    Optional[Any]=3_2      ,      UpperCAmelCase__      :    List[Any]=7_6_8      ,      UpperCAmelCase__      :    int=1_2      ,      UpperCAmelCase__      :    Tuple=1_2      ,      UpperCAmelCase__      :    List[Any]=3_0_7_2      ,      UpperCAmelCase__      :    Dict="gelu"      ,      UpperCAmelCase__      :    Any=0.1      ,      UpperCAmelCase__      :    str=0.1      ,      UpperCAmelCase__      :    Optional[Any]=0.1      ,      UpperCAmelCase__      :    List[Any]=0.0      ,      UpperCAmelCase__      :    str=0.0      ,      UpperCAmelCase__      :    Tuple=0.1      ,      UpperCAmelCase__      :    Optional[int]=0.1      ,      UpperCAmelCase__      :    Tuple=0.02      ,      UpperCAmelCase__      :    str=1E-5      ,      UpperCAmelCase__      :    Any="group"      ,      UpperCAmelCase__      :    Optional[Any]="gelu"      ,      UpperCAmelCase__      :    int=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)      ,      UpperCAmelCase__      :    str=(5, 2, 2, 2, 2, 2, 2)      ,      UpperCAmelCase__      :    Tuple=(1_0, 3, 3, 3, 3, 2, 2)      ,      UpperCAmelCase__      :    Optional[int]=False      ,      UpperCAmelCase__      :    Tuple=1_2_8      ,      UpperCAmelCase__      :    Any=1_6      ,      UpperCAmelCase__      :    int=False      ,      UpperCAmelCase__      :    Dict=True      ,      UpperCAmelCase__      :    List[Any]=0.05      ,      UpperCAmelCase__      :    str=1_0      ,      UpperCAmelCase__      :    Dict=2      ,      UpperCAmelCase__      :    Dict=0.0      ,      UpperCAmelCase__      :    str=1_0      ,      UpperCAmelCase__      :    int=0      ,      UpperCAmelCase__      :    List[Any]=3_2_0      ,      UpperCAmelCase__      :    Union[str, Any]=2      ,      UpperCAmelCase__      :    Optional[Any]=0.1      ,      UpperCAmelCase__      :    Tuple=1_0_0      ,      UpperCAmelCase__      :    Tuple=2_5_6      ,      UpperCAmelCase__      :    int=2_5_6      ,      UpperCAmelCase__      :    str=0.1      ,      UpperCAmelCase__      :    Optional[int]="mean"      ,      UpperCAmelCase__      :    str=False      ,      UpperCAmelCase__      :    List[Any]=False      ,      UpperCAmelCase__      :    Any=2_5_6      ,      UpperCAmelCase__      :    str=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)      ,      UpperCAmelCase__      :    Optional[int]=(5, 3, 3, 1, 1)      ,      UpperCAmelCase__      :    str=(1, 2, 3, 1, 1)      ,      UpperCAmelCase__      :    List[str]=5_1_2      ,      UpperCAmelCase__      :    List[str]=0      ,      UpperCAmelCase__      :    Optional[Any]=1      ,      UpperCAmelCase__      :    List[str]=2      ,      UpperCAmelCase__      :    Any=5_0_4      ,      **UpperCAmelCase__      :    Optional[int]      ,      )	->     Optional[Any]:
						super().__init__(**lowercase_      ,      pad_token_id=lowercase_      ,      bos_token_id=lowercase_      ,      eos_token_id=lowercase_       )
						__SCREAMING_SNAKE_CASE						       =    hidden_size
						__SCREAMING_SNAKE_CASE						       =    feat_extract_norm
						__SCREAMING_SNAKE_CASE						       =    feat_extract_activation
						__SCREAMING_SNAKE_CASE						       =    list(lowercase_       )
						__SCREAMING_SNAKE_CASE						       =    list(lowercase_       )
						__SCREAMING_SNAKE_CASE						       =    list(lowercase_       )
						__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						       =    vocab_size
						__SCREAMING_SNAKE_CASE						       =    num_clusters
						__SCREAMING_SNAKE_CASE						       =    do_stable_layer_norm
						__SCREAMING_SNAKE_CASE						       =    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
						__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

						# SequenceClassification-specific parameter. Feel free to ignore for other classes.
						__SCREAMING_SNAKE_CASE						       =    classifier_proj_size

						# XVector-specific parameters. Feel free to ignore for other classes.
						__SCREAMING_SNAKE_CASE						       =    list(lowercase_       )
						__SCREAMING_SNAKE_CASE						       =    list(lowercase_       )
						__SCREAMING_SNAKE_CASE						       =    list(lowercase_       )
						__SCREAMING_SNAKE_CASE						       =    xvector_output_dim




	@property
	def   UpperCAmelCase_				(			self      :    Dict       )	->     Any:
						return functools.reduce(operator.mul      ,      self.conv_stride      ,      1       )




"""simple docstring"""







from typing import TYPE_CHECKING

from ...utils import _LazyModule


a__    :							Optional[int]            =					{'''tokenization_byt5''': ['''ByT5Tokenizer''']}


if TYPE_CHECKING:
		from .tokenization_byta import ByTaTokenizer
else:
		import sys

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