




'''simple docstring'''







import functools
import operator

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


A			   =logging.get_logger(__name__)

A			   ={
    '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       _a  (     __a			):
       __a    :					List[str]           = """hubert"""
       def __init__(     self						:     str       ,    lowercase						:     int=32       ,    lowercase						:     Any=768       ,    lowercase						:     str=12       ,    lowercase						:     List[str]=12       ,    lowercase						:     Optional[int]=3_072       ,    lowercase						:     Any="gelu"       ,    lowercase						:     List[Any]=0.1       ,    lowercase						:     Tuple=0.1       ,    lowercase						:     Dict=0.1       ,    lowercase						:     Dict=True       ,    lowercase						:     int=0.0       ,    lowercase						:     int=0.1       ,    lowercase						:     Union[str, Any]=0.1       ,    lowercase						:     Union[str, Any]=0.02       ,    lowercase						:     List[Any]=1E-5       ,    lowercase						:     str="group"       ,    lowercase						:     List[str]="gelu"       ,    lowercase						:     Tuple=(512, 512, 512, 512, 512, 512, 512)       ,    lowercase						:     Any=(5, 2, 2, 2, 2, 2, 2)       ,    lowercase						:     Tuple=(10, 3, 3, 3, 3, 2, 2)       ,    lowercase						:     Any=False       ,    lowercase						:     Optional[int]=128       ,    lowercase						:     Tuple=16       ,    lowercase						:     Union[str, Any]=False       ,    lowercase						:     Union[str, Any]=True       ,    lowercase						:     Tuple=0.05       ,    lowercase						:     str=10       ,    lowercase						:     Optional[int]=2       ,    lowercase						:     str=0.0       ,    lowercase						:     Tuple=10       ,    lowercase						:     List[Any]=0       ,    lowercase						:     List[Any]="sum"       ,    lowercase						:     Any=False       ,    lowercase						:     Tuple=False       ,    lowercase						:     Optional[Any]=256       ,    lowercase						:     Union[str, Any]=0       ,    lowercase						:     List[Any]=1       ,    lowercase						:     Union[str, Any]=2       ,    **lowercase						:     Optional[Any]       ,    ):



           '''simple docstring'''

           super().__init__(**lowercase       ,    pad_token_id=lowercase       ,    bos_token_id=lowercase       ,    eos_token_id=lowercase    )
           UpperCAmelCase      	=		hidden_size
           UpperCAmelCase      	=		feat_extract_norm
           UpperCAmelCase      	=		feat_extract_activation
           UpperCAmelCase      	=		list(lowercase    )
           UpperCAmelCase      	=		list(lowercase    )
           UpperCAmelCase      	=		list(lowercase    )
           UpperCAmelCase      	=		conv_bias
           UpperCAmelCase      	=		num_conv_pos_embeddings
           UpperCAmelCase      	=		num_conv_pos_embedding_groups
           UpperCAmelCase      	=		len(self.conv_dim    )
           UpperCAmelCase      	=		num_hidden_layers
           UpperCAmelCase      	=		intermediate_size
           UpperCAmelCase      	=		hidden_act
           UpperCAmelCase      	=		num_attention_heads
           UpperCAmelCase      	=		hidden_dropout
           UpperCAmelCase      	=		attention_dropout
           UpperCAmelCase      	=		activation_dropout
           UpperCAmelCase      	=		feat_proj_layer_norm
           UpperCAmelCase      	=		feat_proj_dropout
           UpperCAmelCase      	=		final_dropout
           UpperCAmelCase      	=		layerdrop
           UpperCAmelCase      	=		layer_norm_eps
           UpperCAmelCase      	=		initializer_range
           UpperCAmelCase      	=		vocab_size
           UpperCAmelCase      	=		do_stable_layer_norm
           UpperCAmelCase      	=		use_weighted_layer_sum
           UpperCAmelCase      	=		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
           UpperCAmelCase      	=		apply_spec_augment
           UpperCAmelCase      	=		mask_time_prob
           UpperCAmelCase      	=		mask_time_length
           UpperCAmelCase      	=		mask_time_min_masks
           UpperCAmelCase      	=		mask_feature_prob
           UpperCAmelCase      	=		mask_feature_length
           UpperCAmelCase      	=		mask_feature_min_masks

           # ctc loss
           UpperCAmelCase      	=		ctc_loss_reduction
           UpperCAmelCase      	=		ctc_zero_infinity







       @property
       def    A				(     self						:     str    ):



           '''simple docstring'''

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










'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A			   ={'configuration_dinat': ['DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DinatConfig']}


try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A			   =[
       'DINAT_PRETRAINED_MODEL_ARCHIVE_LIST',
       'DinatForImageClassification',
       'DinatModel',
       'DinatPreTrainedModel',
       'DinatBackbone',
   ]

if TYPE_CHECKING:
   from .configuration_dinat import DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP, DinatConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_dinat import (
          DINAT_PRETRAINED_MODEL_ARCHIVE_LIST,
          DinatBackbone,
          DinatForImageClassification,
          DinatModel,
          DinatPreTrainedModel,
      )

else:
   import sys

   A			   =_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




