'''simple docstring'''






import functools
import operator

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


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

_UpperCAmelCase						:    Optional[Any]     					=					{
    '''facebook/hubert-base-ls960''': '''https://huggingface.co/facebook/hubert-base-ls960/resolve/main/config.json''',
    # See all Hubert models at https://huggingface.co/models?filter=hubert
}







class lowercase_					(		UpperCamelCase_ ):







   """simple docstring"""

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

        # ctc loss
        _A								=     ctc_loss_reduction
        _A								=     ctc_zero_infinity

   @property
   def   __UpperCAmelCase      (			self			: Any    )     -> Optional[Any]:
        return functools.reduce(operator.mul,   self.conv_stride,   1    )




'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


_UpperCAmelCase						:    Optional[Any]     					=					{
    '''configuration_unispeech_sat''': ['''UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''UniSpeechSatConfig'''],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _UpperCAmelCase						:    Dict     					=					[
       '''UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''UniSpeechSatForAudioFrameClassification''',
       '''UniSpeechSatForCTC''',
       '''UniSpeechSatForPreTraining''',
       '''UniSpeechSatForSequenceClassification''',
       '''UniSpeechSatForXVector''',
       '''UniSpeechSatModel''',
       '''UniSpeechSatPreTrainedModel''',
   ]

if TYPE_CHECKING:
   from .configuration_unispeech_sat import UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechSatConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_unispeech_sat import (
          UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST,
          UniSpeechSatForAudioFrameClassification,
          UniSpeechSatForCTC,
          UniSpeechSatForPreTraining,
          UniSpeechSatForSequenceClassification,
          UniSpeechSatForXVector,
          UniSpeechSatModel,
          UniSpeechSatPreTrainedModel,
      )

else:
   import sys

   _UpperCAmelCase						:    int     					=					_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



