
import functools
import operator

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


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

__A						:							int							=  {
    """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 			UpperCAmelCase_      (   A       ):




							'''simple docstring'''



							a__						  =     """wavlm"""





							def __init__(					self       :	int       ,     a       :	Any=32       ,     a       :	List[str]=768       ,     a       :	int=12       ,     a       :	List[str]=12       ,     a       :	Tuple=3_072       ,     a       :	Union[str, Any]="gelu"       ,     a       :	Union[str, Any]=0.1       ,     a       :	Optional[Any]=0.1       ,     a       :	Tuple=0.1       ,     a       :	Tuple=0.0       ,     a       :	List[str]=0.1       ,     a       :	List[str]=0.1       ,     a       :	Tuple=0.02       ,     a       :	int=1E-5       ,     a       :	Optional[int]="group"       ,     a       :	str="gelu"       ,     a       :	Optional[int]=(512, 512, 512, 512, 512, 512, 512)       ,     a       :	str=(5, 2, 2, 2, 2, 2, 2)       ,     a       :	Any=(10, 3, 3, 3, 3, 2, 2)       ,     a       :	Dict=False       ,     a       :	Tuple=128       ,     a       :	Optional[int]=16       ,     a       :	int=320       ,     a       :	Optional[int]=800       ,     a       :	Optional[Any]=False       ,     a       :	Optional[Any]=True       ,     a       :	Union[str, Any]=0.05       ,     a       :	Any=10       ,     a       :	Optional[int]=2       ,     a       :	List[Any]=0.0       ,     a       :	Optional[int]=10       ,     a       :	str=320       ,     a       :	str=2       ,     a       :	int=0.1       ,     a       :	int=100       ,     a       :	Optional[Any]=256       ,     a       :	Union[str, Any]=256       ,     a       :	Tuple=0.1       ,     a       :	List[str]="mean"       ,     a       :	Union[str, Any]=False       ,     a       :	List[Any]=False       ,     a       :	List[Any]=256       ,     a       :	Tuple=(512, 512, 512, 512, 1_500)       ,     a       :	Optional[int]=(5, 3, 3, 1, 1)       ,     a       :	List[str]=(1, 2, 3, 1, 1)       ,     a       :	Tuple=512       ,     a       :	List[str]=80       ,     a       :	List[Any]=0       ,     a       :	List[Any]=1       ,     a       :	List[Any]=2       ,     a       :	Tuple=False       ,     a       :	Tuple=3       ,     a       :	Union[str, Any]=2       ,     a       :	str=3       ,     a       :	Dict=None       ,     **a       :	Tuple       ,     )			->					List[str]:
										super().__init__(**a       ,     pad_token_id=a       ,     bos_token_id=a       ,     eos_token_id=a			)
										SCREAMING_SNAKE_CASE           =					hidden_size
										SCREAMING_SNAKE_CASE           =					feat_extract_norm
										SCREAMING_SNAKE_CASE           =					feat_extract_activation
										SCREAMING_SNAKE_CASE           =					list(a			)
										SCREAMING_SNAKE_CASE           =					list(a			)
										SCREAMING_SNAKE_CASE           =					list(a			)
										SCREAMING_SNAKE_CASE           =					conv_bias
										SCREAMING_SNAKE_CASE           =					num_buckets
										SCREAMING_SNAKE_CASE           =					max_bucket_distance
										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           =					num_ctc_classes
										SCREAMING_SNAKE_CASE           =					vocab_size
										SCREAMING_SNAKE_CASE           =					do_stable_layer_norm
										SCREAMING_SNAKE_CASE           =					use_weighted_layer_sum
										SCREAMING_SNAKE_CASE           =					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
										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

										# 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           =					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

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

										# 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(a			)
										SCREAMING_SNAKE_CASE           =					list(a			)
										SCREAMING_SNAKE_CASE           =					list(a			)
										SCREAMING_SNAKE_CASE           =					xvector_output_dim







							@property
							def    _UpperCAmelCase     (					self       :	str			)			->					str:
										return functools.reduce(operator.mul       ,     self.conv_stride       ,     1			)












from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__A						:							Dict							=  {
    """configuration_nllb_moe""": [
        """NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """NllbMoeConfig""",
    ]
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__A						:							List[Any]							=  [
		    """NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """NllbMoeForConditionalGeneration""",
		    """NllbMoeModel""",
		    """NllbMoePreTrainedModel""",
		    """NllbMoeTop2Router""",
		    """NllbMoeSparseMLP""",
		]


if TYPE_CHECKING:
		from .configuration_nllb_moe import (
		    NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    NllbMoeConfig,
		)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_nllb_moe import (
				    NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST,
				    NllbMoeForConditionalGeneration,
				    NllbMoeModel,
				    NllbMoePreTrainedModel,
				    NllbMoeSparseMLP,
				    NllbMoeTopaRouter,
				)


else:
		import sys

		__A						:							Optional[Any]							=  _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)






