"""simple docstring"""




import functools
import operator

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


_a				:		Any	   =       logging.get_logger(__name__)

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

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

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

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

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

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






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





"""simple docstring"""




from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader
class 						__A							(			SCREAMING_SNAKE_CASE_		):






     def __init__(		self    ,					a__    ,					a__ = None    ,					a__ = None    ,					a__ = True    ,					a__ = None    ,					a__ = False    ,					a__ = None    ,					a__ = True    ,					a__ = "arrow"    ,					**a__    ,					):
       super().__init__(
           split=a__    ,					features=a__    ,					cache_dir=a__    ,					keep_in_memory=a__    ,					streaming=a__    ,					**a__    ,					)
       _lowerCAmelCase						:	List[Any]        =					load_from_cache_file
       _lowerCAmelCase						:	str        =					file_format
       _lowerCAmelCase						:	Dict        =					Spark(
           df=a__    ,					features=a__    ,					cache_dir=a__    ,					working_dir=a__    ,					**a__    ,					)






     def    __A  (		self  ):
       if self.streaming:
         return self.builder.as_streaming_dataset(split=self.split  )
       _lowerCAmelCase						:	Dict        =					None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
       self.builder.download_and_prepare(
           download_mode=a__    ,					file_format=self._file_format    ,					)
       return self.builder.as_dataset(split=self.split  )




