





_A					:				str				=			"""0.18.2"""

from .configuration_utils import ConfigMixin
from .utils import (
    OptionalDependencyNotAvailable,
    is_flax_available,
    is_inflect_available,
    is_invisible_watermark_available,
    is_k_diffusion_available,
    is_k_diffusion_version,
    is_librosa_available,
    is_note_seq_available,
    is_onnx_available,
    is_scipy_available,
    is_torch_available,
    is_torchsde_available,
    is_transformers_available,
    is_transformers_version,
    is_unidecode_available,
    logging,
)


try:
  if not is_onnx_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_onnx_objects import *  # noqa F403
else:
  from .pipelines import OnnxRuntimeModel

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_pt_objects import *  # noqa F403
else:
  from .models import (
      AutoencoderKL,
      ControlNetModel,
      ModelMixin,
      PriorTransformer,
      TaFilmDecoder,
      TransformeraDModel,
      UNetaDModel,
      UNetaDConditionModel,
      UNetaDModel,
      UNetaDConditionModel,
      VQModel,
  )
  from .optimization import (
      get_constant_schedule,
      get_constant_schedule_with_warmup,
      get_cosine_schedule_with_warmup,
      get_cosine_with_hard_restarts_schedule_with_warmup,
      get_linear_schedule_with_warmup,
      get_polynomial_decay_schedule_with_warmup,
      get_scheduler,
  )
  from .pipelines import (
      AudioPipelineOutput,
      ConsistencyModelPipeline,
      DanceDiffusionPipeline,
      DDIMPipeline,
      DDPMPipeline,
      DiffusionPipeline,
      DiTPipeline,
      ImagePipelineOutput,
      KarrasVePipeline,
      LDMPipeline,
      LDMSuperResolutionPipeline,
      PNDMPipeline,
      RePaintPipeline,
      ScoreSdeVePipeline,
  )
  from .schedulers import (
      CMStochasticIterativeScheduler,
      DDIMInverseScheduler,
      DDIMParallelScheduler,
      DDIMScheduler,
      DDPMParallelScheduler,
      DDPMScheduler,
      DEISMultistepScheduler,
      DPMSolverMultistepInverseScheduler,
      DPMSolverMultistepScheduler,
      DPMSolverSinglestepScheduler,
      EulerAncestralDiscreteScheduler,
      EulerDiscreteScheduler,
      HeunDiscreteScheduler,
      IPNDMScheduler,
      KarrasVeScheduler,
      KDPMaAncestralDiscreteScheduler,
      KDPMaDiscreteScheduler,
      PNDMScheduler,
      RePaintScheduler,
      SchedulerMixin,
      ScoreSdeVeScheduler,
      UnCLIPScheduler,
      UniPCMultistepScheduler,
      VQDiffusionScheduler,
  )
  from .training_utils import EMAModel

try:
  if not (is_torch_available() and is_scipy_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_torch_and_scipy_objects import *  # noqa F403
else:
  from .schedulers import LMSDiscreteScheduler

try:
  if not (is_torch_available() and is_torchsde_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_torch_and_torchsde_objects import *  # noqa F403
else:
  from .schedulers import DPMSolverSDEScheduler

try:
  if not (is_torch_available() and is_transformers_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
  from .pipelines import (
      AltDiffusionImgaImgPipeline,
      AltDiffusionPipeline,
      AudioLDMPipeline,
      CycleDiffusionPipeline,
      IFImgaImgPipeline,
      IFImgaImgSuperResolutionPipeline,
      IFInpaintingPipeline,
      IFInpaintingSuperResolutionPipeline,
      IFPipeline,
      IFSuperResolutionPipeline,
      ImageTextPipelineOutput,
      KandinskyImgaImgPipeline,
      KandinskyInpaintPipeline,
      KandinskyPipeline,
      KandinskyPriorPipeline,
      KandinskyVaaControlnetImgaImgPipeline,
      KandinskyVaaControlnetPipeline,
      KandinskyVaaImgaImgPipeline,
      KandinskyVaaInpaintPipeline,
      KandinskyVaaPipeline,
      KandinskyVaaPriorEmbaEmbPipeline,
      KandinskyVaaPriorPipeline,
      LDMTextToImagePipeline,
      PaintByExamplePipeline,
      SemanticStableDiffusionPipeline,
      ShapEImgaImgPipeline,
      ShapEPipeline,
      StableDiffusionAttendAndExcitePipeline,
      StableDiffusionControlNetImgaImgPipeline,
      StableDiffusionControlNetInpaintPipeline,
      StableDiffusionControlNetPipeline,
      StableDiffusionDepthaImgPipeline,
      StableDiffusionDiffEditPipeline,
      StableDiffusionImageVariationPipeline,
      StableDiffusionImgaImgPipeline,
      StableDiffusionInpaintPipeline,
      StableDiffusionInpaintPipelineLegacy,
      StableDiffusionInstructPixaPixPipeline,
      StableDiffusionLatentUpscalePipeline,
      StableDiffusionLDMaDPipeline,
      StableDiffusionModelEditingPipeline,
      StableDiffusionPanoramaPipeline,
      StableDiffusionParadigmsPipeline,
      StableDiffusionPipeline,
      StableDiffusionPipelineSafe,
      StableDiffusionPixaPixZeroPipeline,
      StableDiffusionSAGPipeline,
      StableDiffusionUpscalePipeline,
      StableUnCLIPImgaImgPipeline,
      StableUnCLIPPipeline,
      TextToVideoSDPipeline,
      TextToVideoZeroPipeline,
      UnCLIPImageVariationPipeline,
      UnCLIPPipeline,
      UniDiffuserModel,
      UniDiffuserPipeline,
      UniDiffuserTextDecoder,
      VersatileDiffusionDualGuidedPipeline,
      VersatileDiffusionImageVariationPipeline,
      VersatileDiffusionPipeline,
      VersatileDiffusionTextToImagePipeline,
      VideoToVideoSDPipeline,
      VQDiffusionPipeline,
  )

try:
  if not (is_torch_available() and is_transformers_available() and is_invisible_watermark_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_torch_and_transformers_and_invisible_watermark_objects import *  # noqa F403
else:
  from .pipelines import StableDiffusionXLImgaImgPipeline, StableDiffusionXLPipeline

try:
  if not (is_torch_available() and is_transformers_available() and is_k_diffusion_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_torch_and_transformers_and_k_diffusion_objects import *  # noqa F403
else:
  from .pipelines import StableDiffusionKDiffusionPipeline

try:
  if not (is_torch_available() and is_transformers_available() and is_onnx_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_torch_and_transformers_and_onnx_objects import *  # noqa F403
else:
  from .pipelines import (
      OnnxStableDiffusionImgaImgPipeline,
      OnnxStableDiffusionInpaintPipeline,
      OnnxStableDiffusionInpaintPipelineLegacy,
      OnnxStableDiffusionPipeline,
      OnnxStableDiffusionUpscalePipeline,
      StableDiffusionOnnxPipeline,
  )

try:
  if not (is_torch_available() and is_librosa_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_torch_and_librosa_objects import *  # noqa F403
else:
  from .pipelines import AudioDiffusionPipeline, Mel

try:
  if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_transformers_and_torch_and_note_seq_objects import *  # noqa F403
else:
  from .pipelines import SpectrogramDiffusionPipeline

try:
  if not is_flax_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_flax_objects import *  # noqa F403
else:
  from .models.controlnet_flax import FlaxControlNetModel
  from .models.modeling_flax_utils import FlaxModelMixin
  from .models.unet_ad_condition_flax import FlaxUNetaDConditionModel
  from .models.vae_flax import FlaxAutoencoderKL
  from .pipelines import FlaxDiffusionPipeline
  from .schedulers import (
      FlaxDDIMScheduler,
      FlaxDDPMScheduler,
      FlaxDPMSolverMultistepScheduler,
      FlaxKarrasVeScheduler,
      FlaxLMSDiscreteScheduler,
      FlaxPNDMScheduler,
      FlaxSchedulerMixin,
      FlaxScoreSdeVeScheduler,
  )


try:
  if not (is_flax_available() and is_transformers_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_flax_and_transformers_objects import *  # noqa F403
else:
  from .pipelines import (
      FlaxStableDiffusionControlNetPipeline,
      FlaxStableDiffusionImgaImgPipeline,
      FlaxStableDiffusionInpaintPipeline,
      FlaxStableDiffusionPipeline,
  )

try:
  if not (is_note_seq_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from .utils.dummy_note_seq_objects import *  # noqa F403
else:
  from .pipelines import MidiProcessor





import functools
import operator

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


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

_lowerCAmelCase	:   Tuple    =   {
    "microsoft/wavlm-base": "https://huggingface.co/microsoft/wavlm-base/resolve/main/config.json",
    # See all WavLM models at https://huggingface.co/models?filter=wavlm
}


class 	__snake_case   ( SCREAMING_SNAKE_CASE ):
		SCREAMING_SNAKE_CASE__								=	'wavlm'
		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.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_=320    ,a_=800    ,a_=False    ,a_=True    ,a_=0.05    ,a_=10    ,a_=2    ,a_=0.0    ,a_=10    ,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_=(512, 512, 512, 512, 1500)    ,a_=(5, 3, 3, 1, 1)    ,a_=(1, 2, 3, 1, 1)    ,a_=512    ,a_=80    ,a_=0    ,a_=1    ,a_=2    ,a_=False    ,a_=3    ,a_=2    ,a_=3    ,a_=None    ,**a_    ,):







						"""simple docstring"""
						super().__init__(**a_    ,pad_token_id=a_    ,bos_token_id=a_    ,eos_token_id=a_						)
						lowerCAmelCase__		  =  hidden_size
						lowerCAmelCase__		  =  feat_extract_norm
						lowerCAmelCase__		  =  feat_extract_activation
						lowerCAmelCase__		  =  list(a_						)
						lowerCAmelCase__		  =  list(a_						)
						lowerCAmelCase__		  =  list(a_						)
						lowerCAmelCase__		  =  conv_bias
						lowerCAmelCase__		  =  num_buckets
						lowerCAmelCase__		  =  max_bucket_distance
						lowerCAmelCase__		  =  num_conv_pos_embeddings
						lowerCAmelCase__		  =  num_conv_pos_embedding_groups
						lowerCAmelCase__		  =  len(self.conv_dim						)
						lowerCAmelCase__		  =  num_hidden_layers
						lowerCAmelCase__		  =  intermediate_size
						lowerCAmelCase__		  =  hidden_act
						lowerCAmelCase__		  =  num_attention_heads
						lowerCAmelCase__		  =  hidden_dropout
						lowerCAmelCase__		  =  attention_dropout
						lowerCAmelCase__		  =  activation_dropout
						lowerCAmelCase__		  =  feat_proj_dropout
						lowerCAmelCase__		  =  final_dropout
						lowerCAmelCase__		  =  layerdrop
						lowerCAmelCase__		  =  layer_norm_eps
						lowerCAmelCase__		  =  initializer_range
						lowerCAmelCase__		  =  num_ctc_classes
						lowerCAmelCase__		  =  vocab_size
						lowerCAmelCase__		  =  do_stable_layer_norm
						lowerCAmelCase__		  =  use_weighted_layer_sum
						lowerCAmelCase__		  =  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
						lowerCAmelCase__		  =  apply_spec_augment
						lowerCAmelCase__		  =  mask_time_prob
						lowerCAmelCase__		  =  mask_time_length
						lowerCAmelCase__		  =  mask_time_min_masks
						lowerCAmelCase__		  =  mask_feature_prob
						lowerCAmelCase__		  =  mask_feature_length

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

						# ctc loss
						lowerCAmelCase__		  =  ctc_loss_reduction
						lowerCAmelCase__		  =  ctc_zero_infinity

						# adapter
						lowerCAmelCase__		  =  add_adapter
						lowerCAmelCase__		  =  adapter_kernel_size
						lowerCAmelCase__		  =  adapter_stride
						lowerCAmelCase__		  =  num_adapter_layers
						lowerCAmelCase__		  =  output_hidden_size or hidden_size

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

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



		@property
		def 						SCREAMING_SNAKE_CASE_					(							self						):







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