import functools
import operator

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


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

_SCREAMING_SNAKE_CASE  :		int        =      {
    '''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     _SCREAMING_SNAKE_CASE       ( UpperCAmelCase							):



   '''simple docstring'''



   __UpperCAmelCase  :       int						=						"hubert"







   def __init__(  self   ,							_SCREAMING_SNAKE_CASE=32   ,							_SCREAMING_SNAKE_CASE=768   ,							_SCREAMING_SNAKE_CASE=12   ,							_SCREAMING_SNAKE_CASE=12   ,							_SCREAMING_SNAKE_CASE=3072   ,							_SCREAMING_SNAKE_CASE="gelu"   ,							_SCREAMING_SNAKE_CASE=0.1   ,							_SCREAMING_SNAKE_CASE=0.1   ,							_SCREAMING_SNAKE_CASE=0.1   ,							_SCREAMING_SNAKE_CASE=True   ,							_SCREAMING_SNAKE_CASE=0.0   ,							_SCREAMING_SNAKE_CASE=0.1   ,							_SCREAMING_SNAKE_CASE=0.1   ,							_SCREAMING_SNAKE_CASE=0.02   ,							_SCREAMING_SNAKE_CASE=1E-5   ,							_SCREAMING_SNAKE_CASE="group"   ,							_SCREAMING_SNAKE_CASE="gelu"   ,							_SCREAMING_SNAKE_CASE=(512, 512, 512, 512, 512, 512, 512)   ,							_SCREAMING_SNAKE_CASE=(5, 2, 2, 2, 2, 2, 2)   ,							_SCREAMING_SNAKE_CASE=(10, 3, 3, 3, 3, 2, 2)   ,							_SCREAMING_SNAKE_CASE=False   ,							_SCREAMING_SNAKE_CASE=128   ,							_SCREAMING_SNAKE_CASE=16   ,							_SCREAMING_SNAKE_CASE=False   ,							_SCREAMING_SNAKE_CASE=True   ,							_SCREAMING_SNAKE_CASE=0.05   ,							_SCREAMING_SNAKE_CASE=10   ,							_SCREAMING_SNAKE_CASE=2   ,							_SCREAMING_SNAKE_CASE=0.0   ,							_SCREAMING_SNAKE_CASE=10   ,							_SCREAMING_SNAKE_CASE=0   ,							_SCREAMING_SNAKE_CASE="sum"   ,							_SCREAMING_SNAKE_CASE=False   ,							_SCREAMING_SNAKE_CASE=False   ,							_SCREAMING_SNAKE_CASE=256   ,							_SCREAMING_SNAKE_CASE=0   ,							_SCREAMING_SNAKE_CASE=1   ,							_SCREAMING_SNAKE_CASE=2   ,							**_SCREAMING_SNAKE_CASE   ,							):


      '''simple docstring'''

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

      # ctc loss
      __lowerCamelCase								=				ctc_loss_reduction
      __lowerCamelCase								=				ctc_zero_infinity







   @property
   def       _A							(  self  ):


      '''simple docstring'''

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







"""simple docstring"""







from typing import TYPE_CHECKING

from ...utils import _LazyModule


_SCREAMING_SNAKE_CASE  :		List[Any]        =      {'''tokenization_phobert''': ['''PhobertTokenizer''']}


if TYPE_CHECKING:
     from .tokenization_phobert import PhobertTokenizer

else:
     import sys

     _SCREAMING_SNAKE_CASE  :		List[Any]        =      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






