


import functools
import operator

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


__UpperCAmelCase    				=     logging.get_logger(__name__)

__UpperCAmelCase    				=     {
    "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 A__    ( UpperCAmelCase_ ):



 """simple docstring"""







 _lowercase     :					Union[str, Any]      =						'''wavlm'''

 def __init__(		self :	Dict     ,						A_ :	Union[str, Any]=3_2     ,						A_ :	int=7_6_8     ,						A_ :	Union[str, Any]=1_2     ,						A_ :	Optional[Any]=1_2     ,						A_ :	str=3_0_7_2     ,						A_ :	Optional[int]="gelu"     ,						A_ :	List[str]=0.1     ,						A_ :	Any=0.1     ,						A_ :	List[Any]=0.1     ,						A_ :	int=0.0     ,						A_ :	Tuple=0.1     ,						A_ :	Optional[Any]=0.1     ,						A_ :	Any=0.02     ,						A_ :	Optional[int]=1E-5     ,						A_ :	List[str]="group"     ,						A_ :	List[str]="gelu"     ,						A_ :	Any=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)     ,						A_ :	List[Any]=(5, 2, 2, 2, 2, 2, 2)     ,						A_ :	Union[str, Any]=(1_0, 3, 3, 3, 3, 2, 2)     ,						A_ :	Any=False     ,						A_ :	Optional[Any]=1_2_8     ,						A_ :	str=1_6     ,						A_ :	str=3_2_0     ,						A_ :	Optional[Any]=8_0_0     ,						A_ :	Tuple=False     ,						A_ :	Union[str, Any]=True     ,						A_ :	int=0.05     ,						A_ :	List[Any]=1_0     ,						A_ :	Optional[int]=2     ,						A_ :	Union[str, Any]=0.0     ,						A_ :	Dict=1_0     ,						A_ :	Optional[Any]=3_2_0     ,						A_ :	Optional[int]=2     ,						A_ :	Any=0.1     ,						A_ :	Optional[Any]=1_0_0     ,						A_ :	Tuple=2_5_6     ,						A_ :	Dict=2_5_6     ,						A_ :	Optional[int]=0.1     ,						A_ :	List[str]="mean"     ,						A_ :	Dict=False     ,						A_ :	List[str]=False     ,						A_ :	Dict=2_5_6     ,						A_ :	str=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)     ,						A_ :	Optional[int]=(5, 3, 3, 1, 1)     ,						A_ :	List[Any]=(1, 2, 3, 1, 1)     ,						A_ :	Optional[Any]=5_1_2     ,						A_ :	str=8_0     ,						A_ :	str=0     ,						A_ :	Optional[Any]=1     ,						A_ :	Tuple=2     ,						A_ :	int=False     ,						A_ :	int=3     ,						A_ :	List[Any]=2     ,						A_ :	int=3     ,						A_ :	Any=None     ,						**A_ :	Optional[int]     ,						):






      '''simple docstring'''




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

      # parameters for pretraining with codevector quantized representations
      _lowerCAmelCase   :					Optional[Any]        =    num_codevectors_per_group
      _lowerCAmelCase   :					Optional[int]        =    num_codevector_groups
      _lowerCAmelCase   :					List[Any]        =    contrastive_logits_temperature
      _lowerCAmelCase   :					Optional[Any]        =    num_negatives
      _lowerCAmelCase   :					Tuple        =    codevector_dim
      _lowerCAmelCase   :					Tuple        =    proj_codevector_dim
      _lowerCAmelCase   :					Optional[Any]        =    diversity_loss_weight

      # ctc loss
      _lowerCAmelCase   :					Any        =    ctc_loss_reduction
      _lowerCAmelCase   :					List[str]        =    ctc_zero_infinity

      # adapter
      _lowerCAmelCase   :					Tuple        =    add_adapter
      _lowerCAmelCase   :					Tuple        =    adapter_kernel_size
      _lowerCAmelCase   :					str        =    adapter_stride
      _lowerCAmelCase   :					Tuple        =    num_adapter_layers
      _lowerCAmelCase   :					int        =    output_hidden_size or hidden_size

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

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


 @property
 def    __magic_name__       (		self :	Dict       ):






      '''simple docstring'''




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









import warnings

from ...utils import logging
from .image_processing_chinese_clip import ChineseCLIPImageProcessor


__UpperCAmelCase    				=     logging.get_logger(__name__)





class A__    ( A ):



 """simple docstring"""







 def __init__(		self :	Tuple     ,						*A_ :	Optional[int]     ,						**A_ :	int       ):






      '''simple docstring'''




      warnings.warn(
          "The class ChineseCLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers."
          " Please use ChineseCLIPImageProcessor instead."     ,						A_     ,						)
      super().__init__(*A_     ,						**A_       )






