



import functools
import operator

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


__A   			=logging.get_logger(__name__)

__A   			={
    "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__			(			__UpperCamelCase   ):




			'''simple docstring'''






			UpperCamelCase									=       """unispeech-sat"""




			def __init__(   self							: str       ,       a_							: Optional[int]=32       ,       a_							: Tuple=7_68       ,       a_							: str=12       ,       a_							: List[str]=12       ,       a_							: Optional[int]=30_72       ,       a_							: Any="gelu"       ,       a_							: Tuple=0.1       ,       a_							: str=0.1       ,       a_							: List[str]=0.1       ,       a_							: Optional[int]=0.0       ,       a_							: Tuple=0.0       ,       a_							: List[str]=0.1       ,       a_							: List[str]=0.1       ,       a_							: Union[str, Any]=0.0_2       ,       a_							: Optional[Any]=1e-5       ,       a_							: List[Any]="group"       ,       a_							: List[str]="gelu"       ,       a_							: str=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)       ,       a_							: str=(5, 2, 2, 2, 2, 2, 2)       ,       a_							: Dict=(10, 3, 3, 3, 3, 2, 2)       ,       a_							: Any=False       ,       a_							: int=1_28       ,       a_							: Tuple=16       ,       a_							: Optional[Any]=False       ,       a_							: int=True       ,       a_							: List[Any]=0.0_5       ,       a_							: str=10       ,       a_							: int=2       ,       a_							: Dict=0.0       ,       a_							: str=10       ,       a_							: Optional[Any]=0       ,       a_							: Union[str, Any]=3_20       ,       a_							: Union[str, Any]=2       ,       a_							: Union[str, Any]=0.1       ,       a_							: str=1_00       ,       a_							: List[str]=2_56       ,       a_							: Optional[Any]=2_56       ,       a_							: Union[str, Any]=0.1       ,       a_							: Optional[Any]="mean"       ,       a_							: int=False       ,       a_							: Tuple=False       ,       a_							: Any=2_56       ,       a_							: int=(5_12, 5_12, 5_12, 5_12, 15_00)       ,       a_							: Optional[Any]=(5, 3, 3, 1, 1)       ,       a_							: Union[str, Any]=(1, 2, 3, 1, 1)       ,       a_							: int=5_12       ,       a_							: Tuple=0       ,       a_							: List[str]=1       ,       a_							: Optional[int]=2       ,       a_							: Union[str, Any]=5_04       ,       **a_							: List[str]       ,       ):
					'''simple docstring'''





					super().__init__(**a_       ,       pad_token_id=a_       ,       bos_token_id=a_       ,       eos_token_id=a_ )
					__UpperCAmelCase    :     List[Any]													=	hidden_size
					__UpperCAmelCase    :     Any													=	feat_extract_norm
					__UpperCAmelCase    :     int													=	feat_extract_activation
					__UpperCAmelCase    :     Tuple													=	list(a_ )
					__UpperCAmelCase    :     List[str]													=	list(a_ )
					__UpperCAmelCase    :     str													=	list(a_ )
					__UpperCAmelCase    :     Tuple													=	conv_bias
					__UpperCAmelCase    :     List[str]													=	num_conv_pos_embeddings
					__UpperCAmelCase    :     Any													=	num_conv_pos_embedding_groups
					__UpperCAmelCase    :     List[str]													=	len(self.conv_dim )
					__UpperCAmelCase    :     List[Any]													=	num_hidden_layers
					__UpperCAmelCase    :     List[Any]													=	intermediate_size
					__UpperCAmelCase    :     Dict													=	hidden_act
					__UpperCAmelCase    :     str													=	num_attention_heads
					__UpperCAmelCase    :     str													=	hidden_dropout
					__UpperCAmelCase    :     Union[str, Any]													=	attention_dropout
					__UpperCAmelCase    :     Optional[Any]													=	activation_dropout
					__UpperCAmelCase    :     List[str]													=	feat_proj_dropout
					__UpperCAmelCase    :     Union[str, Any]													=	final_dropout
					__UpperCAmelCase    :     int													=	layerdrop
					__UpperCAmelCase    :     Tuple													=	layer_norm_eps
					__UpperCAmelCase    :     List[Any]													=	initializer_range
					__UpperCAmelCase    :     Tuple													=	vocab_size
					__UpperCAmelCase    :     Optional[int]													=	num_clusters
					__UpperCAmelCase    :     Dict													=	do_stable_layer_norm
					__UpperCAmelCase    :     Any													=	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
					__UpperCAmelCase    :     List[Any]													=	apply_spec_augment
					__UpperCAmelCase    :     List[Any]													=	mask_time_prob
					__UpperCAmelCase    :     List[Any]													=	mask_time_length
					__UpperCAmelCase    :     List[Any]													=	mask_time_min_masks
					__UpperCAmelCase    :     List[str]													=	mask_feature_prob
					__UpperCAmelCase    :     Any													=	mask_feature_length
					__UpperCAmelCase    :     List[Any]													=	mask_feature_min_masks

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

					# ctc loss
					__UpperCAmelCase    :     Tuple													=	ctc_loss_reduction
					__UpperCAmelCase    :     List[Any]													=	ctc_zero_infinity

					# SequenceClassification-specific parameter. Feel free to ignore for other classes.
					__UpperCAmelCase    :     Dict													=	classifier_proj_size

					# XVector-specific parameters. Feel free to ignore for other classes.
					__UpperCAmelCase    :     Tuple													=	list(a_ )
					__UpperCAmelCase    :     int													=	list(a_ )
					__UpperCAmelCase    :     Union[str, Any]													=	list(a_ )
					__UpperCAmelCase    :     str													=	xvector_output_dim




			@property
			def  snake_case__     (   self							: Dict ):
					'''simple docstring'''





					return functools.reduce(operator.mul       ,       self.conv_stride       ,       1 )










from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
				if not (is_transformers_available() and is_torch_available()):
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				from ...utils.dummy_torch_and_transformers_objects import KandinskyPipeline, KandinskyPriorPipeline
else:
				from .pipeline_kandinsky import KandinskyPipeline
				from .pipeline_kandinsky_imgaimg import KandinskyImgaImgPipeline
				from .pipeline_kandinsky_inpaint import KandinskyInpaintPipeline
				from .pipeline_kandinsky_prior import KandinskyPriorPipeline, KandinskyPriorPipelineOutput
				from .text_encoder import MultilingualCLIP





