"""simple docstring"""




import math

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


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

_a   :	int 					=     {
    'facebook/data2vec-base-960h': 'https://huggingface.co/facebook/data2vec-audio-base-960h/resolve/main/config.json',
    # See all Data2VecAudio models at https://huggingface.co/models?filter=data2vec-audio
}
class 		__A							(				SCREAMING_SNAKE_CASE_	):
     _UpperCamelCase							:    Optional[Any]	      =	"data2vec-audio"






     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.0_2       ,  a__=1e-5       ,  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__=16       ,  a__=19       ,  a__=5       ,  a__=0.0_5       ,  a__=10       ,  a__=2       ,  a__=0.0       ,  a__=10       ,  a__=0       ,  a__="sum"       ,  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__=0       ,  a__=1       ,  a__=2       ,  a__=False       ,  a__=3       ,  a__=2       ,  a__=3       ,  a__=None       ,  **a__       ,  ):
       super().__init__(**a__       ,  pad_token_id=a__       ,  bos_token_id=a__       ,  eos_token_id=a__						)
       _lowerCAmelCase		: List[Any]						    =  hidden_size
       _lowerCAmelCase		: Optional[int]						    =  feat_extract_activation
       _lowerCAmelCase		: Any						    =  list(a__						)
       _lowerCAmelCase		: Dict						    =  list(a__						)
       _lowerCAmelCase		: Union[str, Any]						    =  list(a__						)
       _lowerCAmelCase		: int						    =  conv_bias
       _lowerCAmelCase		: Tuple						    =  num_conv_pos_embeddings
       _lowerCAmelCase		: Dict						    =  num_conv_pos_embedding_groups
       _lowerCAmelCase		: Optional[int]						    =  conv_pos_kernel_size
       _lowerCAmelCase		: str						    =  len(self.conv_dim						)
       _lowerCAmelCase		: List[Any]						    =  num_hidden_layers
       _lowerCAmelCase		: str						    =  intermediate_size
       _lowerCAmelCase		: Any						    =  hidden_act
       _lowerCAmelCase		: Union[str, Any]						    =  num_attention_heads
       _lowerCAmelCase		: str						    =  hidden_dropout
       _lowerCAmelCase		: List[str]						    =  attention_dropout
       _lowerCAmelCase		: Any						    =  activation_dropout
       _lowerCAmelCase		: Tuple						    =  feat_proj_dropout
       _lowerCAmelCase		: Dict						    =  final_dropout
       _lowerCAmelCase		: Union[str, Any]						    =  layerdrop
       _lowerCAmelCase		: int						    =  layer_norm_eps
       _lowerCAmelCase		: int						    =  initializer_range
       _lowerCAmelCase		: Any						    =  vocab_size
       _lowerCAmelCase		: List[str]						    =  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		: Tuple						    =  mask_time_prob
       _lowerCAmelCase		: Any						    =  mask_time_length
       _lowerCAmelCase		: Tuple						    =  mask_time_min_masks
       _lowerCAmelCase		: Tuple						    =  mask_feature_prob
       _lowerCAmelCase		: int						    =  mask_feature_length
       _lowerCAmelCase		: Dict						    =  mask_feature_min_masks

       # ctc loss
       _lowerCAmelCase		: Optional[int]						    =  ctc_loss_reduction
       _lowerCAmelCase		: int						    =  ctc_zero_infinity

       # adapter
       _lowerCAmelCase		: int						    =  add_adapter
       _lowerCAmelCase		: List[Any]						    =  adapter_kernel_size
       _lowerCAmelCase		: Tuple						    =  adapter_stride
       _lowerCAmelCase		: Tuple						    =  num_adapter_layers
       _lowerCAmelCase		: Dict						    =  output_hidden_size or hidden_size

       # SequenceClassification-specific parameter. Feel free to ignore for other classes.
       _lowerCAmelCase		: List[Any]						    =  classifier_proj_size

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






     @property
     def 					__A						(	self						):
       return math.prod(self.conv_stride						)





"""simple docstring"""




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_a   :	Tuple 					=     {'configuration_wavlm': ['WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP', 'WavLMConfig']}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _a   :	str 					=     [
         'WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST',
         'WavLMForAudioFrameClassification',
         'WavLMForCTC',
         'WavLMForSequenceClassification',
         'WavLMForXVector',
         'WavLMModel',
         'WavLMPreTrainedModel',
     ]

if TYPE_CHECKING:
     from .configuration_wavlm import WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP, WavLMConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_wavlm import (
              WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST,
              WavLMForAudioFrameClassification,
              WavLMForCTC,
              WavLMForSequenceClassification,
              WavLMForXVector,
              WavLMModel,
              WavLMPreTrainedModel,
          )

else:
     import sys

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




