






'''simple docstring'''

import functools
import operator

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


UpperCamelCase							=logging.get_logger(__name__)

UpperCamelCase							={
    'microsoft/unispeech-sat-base-100h-libri-ft': (
        'https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft/resolve/main/config.json'
    ),
    # See all UniSpeechSat models at https://huggingface.co/models?filter=unispeech_sat
}




class     A    (      UpperCamelCase_						):






 """simple docstring"""





 __a			:						Optional[Any]      =						'''unispeech-sat'''
 def __init__(							self			,     __lowerCAmelCase=32			,     __lowerCAmelCase=7_68			,     __lowerCAmelCase=12			,     __lowerCAmelCase=12			,     __lowerCAmelCase=30_72			,     __lowerCAmelCase="gelu"			,     __lowerCAmelCase=0.1			,     __lowerCAmelCase=0.1			,     __lowerCAmelCase=0.1			,     __lowerCAmelCase=0.0			,     __lowerCAmelCase=0.0			,     __lowerCAmelCase=0.1			,     __lowerCAmelCase=0.1			,     __lowerCAmelCase=0.02			,     __lowerCAmelCase=1E-5			,     __lowerCAmelCase="group"			,     __lowerCAmelCase="gelu"			,     __lowerCAmelCase=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)			,     __lowerCAmelCase=(5, 2, 2, 2, 2, 2, 2)			,     __lowerCAmelCase=(10, 3, 3, 3, 3, 2, 2)			,     __lowerCAmelCase=False			,     __lowerCAmelCase=1_28			,     __lowerCAmelCase=16			,     __lowerCAmelCase=False			,     __lowerCAmelCase=True			,     __lowerCAmelCase=0.05			,     __lowerCAmelCase=10			,     __lowerCAmelCase=2			,     __lowerCAmelCase=0.0			,     __lowerCAmelCase=10			,     __lowerCAmelCase=0			,     __lowerCAmelCase=3_20			,     __lowerCAmelCase=2			,     __lowerCAmelCase=0.1			,     __lowerCAmelCase=1_00			,     __lowerCAmelCase=2_56			,     __lowerCAmelCase=2_56			,     __lowerCAmelCase=0.1			,     __lowerCAmelCase="mean"			,     __lowerCAmelCase=False			,     __lowerCAmelCase=False			,     __lowerCAmelCase=2_56			,     __lowerCAmelCase=(5_12, 5_12, 5_12, 5_12, 15_00)			,     __lowerCAmelCase=(5, 3, 3, 1, 1)			,     __lowerCAmelCase=(1, 2, 3, 1, 1)			,     __lowerCAmelCase=5_12			,     __lowerCAmelCase=0			,     __lowerCAmelCase=1			,     __lowerCAmelCase=2			,     __lowerCAmelCase=5_04			,     **__lowerCAmelCase			,     ):
       super().__init__(**UpperCamelCase__			,     pad_token_id=UpperCamelCase__			,     bos_token_id=UpperCamelCase__			,     eos_token_id=UpperCamelCase__ )
       UpperCamelCase_				:   Tuple					    =							hidden_size
       UpperCamelCase_				:   Tuple					    =							feat_extract_norm
       UpperCamelCase_				:   Any					    =							feat_extract_activation
       UpperCamelCase_				:   Dict					    =							list(UpperCamelCase__ )
       UpperCamelCase_				:   List[str]					    =							list(UpperCamelCase__ )
       UpperCamelCase_				:   Dict					    =							list(UpperCamelCase__ )
       UpperCamelCase_				:   List[Any]					    =							conv_bias
       UpperCamelCase_				:   Dict					    =							num_conv_pos_embeddings
       UpperCamelCase_				:   Optional[int]					    =							num_conv_pos_embedding_groups
       UpperCamelCase_				:   int					    =							len(self.conv_dim )
       UpperCamelCase_				:   Dict					    =							num_hidden_layers
       UpperCamelCase_				:   Optional[Any]					    =							intermediate_size
       UpperCamelCase_				:   Any					    =							hidden_act
       UpperCamelCase_				:   Dict					    =							num_attention_heads
       UpperCamelCase_				:   Tuple					    =							hidden_dropout
       UpperCamelCase_				:   List[Any]					    =							attention_dropout
       UpperCamelCase_				:   Dict					    =							activation_dropout
       UpperCamelCase_				:   Any					    =							feat_proj_dropout
       UpperCamelCase_				:   Optional[Any]					    =							final_dropout
       UpperCamelCase_				:   Optional[int]					    =							layerdrop
       UpperCamelCase_				:   Union[str, Any]					    =							layer_norm_eps
       UpperCamelCase_				:   Optional[Any]					    =							initializer_range
       UpperCamelCase_				:   Union[str, Any]					    =							vocab_size
       UpperCamelCase_				:   List[str]					    =							num_clusters
       UpperCamelCase_				:   str					    =							do_stable_layer_norm
       UpperCamelCase_				:   Optional[int]					    =							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
       UpperCamelCase_				:   str					    =							apply_spec_augment
       UpperCamelCase_				:   List[str]					    =							mask_time_prob
       UpperCamelCase_				:   Optional[int]					    =							mask_time_length
       UpperCamelCase_				:   int					    =							mask_time_min_masks
       UpperCamelCase_				:   Optional[int]					    =							mask_feature_prob
       UpperCamelCase_				:   Optional[Any]					    =							mask_feature_length
       UpperCamelCase_				:   int					    =							mask_feature_min_masks

       # parameters for pretraining with codevector quantized representations
       UpperCamelCase_				:   Dict					    =							num_codevectors_per_group
       UpperCamelCase_				:   str					    =							num_codevector_groups
       UpperCamelCase_				:   Optional[Any]					    =							contrastive_logits_temperature
       UpperCamelCase_				:   int					    =							feat_quantizer_dropout
       UpperCamelCase_				:   Any					    =							num_negatives
       UpperCamelCase_				:   Optional[Any]					    =							codevector_dim
       UpperCamelCase_				:   Union[str, Any]					    =							proj_codevector_dim
       UpperCamelCase_				:   Optional[int]					    =							diversity_loss_weight

       # ctc loss
       UpperCamelCase_				:   Optional[Any]					    =							ctc_loss_reduction
       UpperCamelCase_				:   Tuple					    =							ctc_zero_infinity

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

       # XVector-specific parameters. Feel free to ignore for other classes.
       UpperCamelCase_				:   int					    =							list(UpperCamelCase__ )
       UpperCamelCase_				:   int					    =							list(UpperCamelCase__ )
       UpperCamelCase_				:   Union[str, Any]					    =							list(UpperCamelCase__ )
       UpperCamelCase_				:   Any					    =							xvector_output_dim





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










'''simple docstring'''

import pytest

import datasets


# Import fixture modules as plugins
UpperCamelCase							=["tests.fixtures.files", "tests.fixtures.hub", "tests.fixtures.fsspec"]



def 							snake_case					(     a_							: List[str]    ,   a_							: Optional[Any]	)       ->				Union[str, Any]:





      """simple docstring"""

      for item in items:
            if any(marker in item.keywords for marker in ["""integration""", """unit"""]	):
                  continue
            item.add_marker(pytest.mark.unit	)



def 							snake_case					(     a_							: Optional[int]	)       ->				Optional[Any]:





      """simple docstring"""

      config.addinivalue_line("""markers"""    ,   """torchaudio_latest: mark test to run with torchaudio>=0.12"""	)



@pytest.fixture(autouse=a_	)
def 							snake_case					(     a_							: Any    ,   a_							: Optional[int]	)       ->				Tuple:





      """simple docstring"""

      UpperCamelCase_				:   Optional[Any]					    =							tmp_path_factory.getbasetemp() / """cache"""
      UpperCamelCase_				:   str					    =							test_hf_cache_home / """datasets"""
      UpperCamelCase_				:   Any					    =							test_hf_cache_home / """metrics"""
      UpperCamelCase_				:   List[Any]					    =							test_hf_cache_home / """modules"""
      monkeypatch.setattr("""datasets.config.HF_DATASETS_CACHE"""    ,   str(a_	)	)
      monkeypatch.setattr("""datasets.config.HF_METRICS_CACHE"""    ,   str(a_	)	)
      monkeypatch.setattr("""datasets.config.HF_MODULES_CACHE"""    ,   str(a_	)	)
      UpperCamelCase_				:   List[Any]					    =							test_hf_datasets_cache / """downloads"""
      monkeypatch.setattr("""datasets.config.DOWNLOADED_DATASETS_PATH"""    ,   str(a_	)	)
      UpperCamelCase_				:   Any					    =							test_hf_datasets_cache / """downloads""" / """extracted"""
      monkeypatch.setattr("""datasets.config.EXTRACTED_DATASETS_PATH"""    ,   str(a_	)	)



@pytest.fixture(autouse=a_    ,   scope="""session"""	)
def 							snake_case					(     )       ->				Any:





      """simple docstring"""

      datasets.disable_progress_bar()



@pytest.fixture(autouse=a_	)
def 							snake_case					(     a_							: Optional[int]	)       ->				Union[str, Any]:





      """simple docstring"""

      monkeypatch.setattr("""datasets.config.HF_UPDATE_DOWNLOAD_COUNTS"""    ,   a_	)



@pytest.fixture
def 							snake_case					(     a_							: int	)       ->				Union[str, Any]:





      """simple docstring"""

      monkeypatch.setattr("""sqlalchemy.util.deprecations.SILENCE_UBER_WARNING"""    ,   a_	)






