




"""simple docstring"""






import functools
import operator

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


lowercase__			=		logging.get_logger(__name__)

lowercase__			=		{
    """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 lowerCAmelCase__      (	lowercase		):






			'''simple docstring'''



			lowerCamelCase__ =     """unispeech-sat"""
			def __init__(    self    , lowercase=32    , lowercase=768    , lowercase=12    , lowercase=12    , lowercase=3072    , lowercase="gelu"    , lowercase=0.1    , lowercase=0.1    , lowercase=0.1    , lowercase=0.0    , lowercase=0.0    , lowercase=0.1    , lowercase=0.1    , lowercase=0.02    , lowercase=1E-5    , lowercase="group"    , lowercase="gelu"    , lowercase=(512, 512, 512, 512, 512, 512, 512)    , lowercase=(5, 2, 2, 2, 2, 2, 2)    , lowercase=(10, 3, 3, 3, 3, 2, 2)    , lowercase=False    , lowercase=128    , lowercase=16    , lowercase=False    , lowercase=True    , lowercase=0.05    , lowercase=10    , lowercase=2    , lowercase=0.0    , lowercase=10    , lowercase=0    , lowercase=320    , lowercase=2    , lowercase=0.1    , lowercase=100    , lowercase=256    , lowercase=256    , lowercase=0.1    , lowercase="mean"    , lowercase=False    , lowercase=False    , lowercase=256    , lowercase=(512, 512, 512, 512, 1500)    , lowercase=(5, 3, 3, 1, 1)    , lowercase=(1, 2, 3, 1, 1)    , lowercase=512    , lowercase=0    , lowercase=1    , lowercase=2    , lowercase=504    , **lowercase    , ):
							super().__init__(**lowercase    , pad_token_id=lowercase    , bos_token_id=lowercase    , eos_token_id=lowercase    )
							_lowerCamelCase	:     List[Any]       =       hidden_size
							_lowerCamelCase	:     int       =       feat_extract_norm
							_lowerCamelCase	:     List[str]       =       feat_extract_activation
							_lowerCamelCase	:     Dict       =       list(lowercase    )
							_lowerCamelCase	:     str       =       list(lowercase    )
							_lowerCamelCase	:     Optional[int]       =       list(lowercase    )
							_lowerCamelCase	:     str       =       conv_bias
							_lowerCamelCase	:     int       =       num_conv_pos_embeddings
							_lowerCamelCase	:     Optional[Any]       =       num_conv_pos_embedding_groups
							_lowerCamelCase	:     Tuple       =       len(self.conv_dim    )
							_lowerCamelCase	:     Optional[int]       =       num_hidden_layers
							_lowerCamelCase	:     Dict       =       intermediate_size
							_lowerCamelCase	:     Any       =       hidden_act
							_lowerCamelCase	:     Dict       =       num_attention_heads
							_lowerCamelCase	:     int       =       hidden_dropout
							_lowerCamelCase	:     Optional[Any]       =       attention_dropout
							_lowerCamelCase	:     Dict       =       activation_dropout
							_lowerCamelCase	:     Optional[int]       =       feat_proj_dropout
							_lowerCamelCase	:     Any       =       final_dropout
							_lowerCamelCase	:     Optional[int]       =       layerdrop
							_lowerCamelCase	:     Any       =       layer_norm_eps
							_lowerCamelCase	:     Union[str, Any]       =       initializer_range
							_lowerCamelCase	:     List[Any]       =       vocab_size
							_lowerCamelCase	:     Dict       =       num_clusters
							_lowerCamelCase	:     Tuple       =       do_stable_layer_norm
							_lowerCamelCase	:     Union[str, 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
							_lowerCamelCase	:     Dict       =       apply_spec_augment
							_lowerCamelCase	:     Union[str, Any]       =       mask_time_prob
							_lowerCamelCase	:     List[Any]       =       mask_time_length
							_lowerCamelCase	:     Dict       =       mask_time_min_masks
							_lowerCamelCase	:     Dict       =       mask_feature_prob
							_lowerCamelCase	:     Optional[int]       =       mask_feature_length
							_lowerCamelCase	:     Optional[Any]       =       mask_feature_min_masks

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

							# ctc loss
							_lowerCamelCase	:     List[Any]       =       ctc_loss_reduction
							_lowerCamelCase	:     Union[str, Any]       =       ctc_zero_infinity

							# SequenceClassification-specific parameter. Feel free to ignore for other classes.
							_lowerCamelCase	:     Optional[int]       =       classifier_proj_size

							# XVector-specific parameters. Feel free to ignore for other classes.
							_lowerCamelCase	:     int       =       list(lowercase    )
							_lowerCamelCase	:     Tuple       =       list(lowercase    )
							_lowerCamelCase	:     Tuple       =       list(lowercase    )
							_lowerCamelCase	:     List[str]       =       xvector_output_dim






			@property
			def    A_       (    self    ):
							return functools.reduce(operator.mul    , self.conv_stride    , 1    )





"""simple docstring"""






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


try:
			if not (is_transformers_available() and is_torch_available() and is_transformers_version(""">=""", """4.25.0""")):
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			from ...utils.dummy_torch_and_transformers_objects import (
			    VersatileDiffusionDualGuidedPipeline,
			    VersatileDiffusionImageVariationPipeline,
			    VersatileDiffusionPipeline,
			    VersatileDiffusionTextToImagePipeline,
			)
else:
			from .modeling_text_unet import UNetFlatConditionModel
			from .pipeline_versatile_diffusion import VersatileDiffusionPipeline
			from .pipeline_versatile_diffusion_dual_guided import VersatileDiffusionDualGuidedPipeline
			from .pipeline_versatile_diffusion_image_variation import VersatileDiffusionImageVariationPipeline
			from .pipeline_versatile_diffusion_text_to_image import VersatileDiffusionTextToImagePipeline