"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_tokenizers_available


lowercase__   			=      {}

try:
 if not is_sentencepiece_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowercase__   			=      ['BarthezTokenizer']

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowercase__   			=      ['BarthezTokenizerFast']


if TYPE_CHECKING:
 try:
  if not is_sentencepiece_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_barthez import BarthezTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_barthez_fast import BarthezTokenizerFast

else:
 import sys

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






import functools
import operator

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


a					:				Dict       =      logging.get_logger(__name__)

a					:				str       =      {
    '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   lowerCamelCase						(	SCREAMING_SNAKE_CASE  ):
       _UpperCamelCase     		=   """hubert"""

       def __init__(      self						,    a__=32						,    a__=7_68						,    a__=12						,    a__=12						,    a__=30_72						,    a__="gelu"						,    a__=0.1						,    a__=0.1						,    a__=0.1						,    a__=True						,    a__=0.0						,    a__=0.1						,    a__=0.1						,    a__=0.02						,    a__=1e-5						,    a__="group"						,    a__="gelu"						,    a__=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)						,    a__=(5, 2, 2, 2, 2, 2, 2)						,    a__=(10, 3, 3, 3, 3, 2, 2)						,    a__=False						,    a__=1_28						,    a__=16						,    a__=False						,    a__=True						,    a__=0.05						,    a__=10						,    a__=2						,    a__=0.0						,    a__=10						,    a__=0						,    a__="sum"						,    a__=False						,    a__=False						,    a__=2_56						,    a__=0						,    a__=1						,    a__=2						,    **a__						,    ):






        '''simple docstring'''






        super().__init__(**a__						,    pad_token_id=a__						,    bos_token_id=a__						,    eos_token_id=a__       )
        snake_case :			List[str]							=   hidden_size
        snake_case :			List[str]							=   feat_extract_norm
        snake_case :			List[str]							=   feat_extract_activation
        snake_case :			Dict							=   list(a__       )
        snake_case :			Tuple							=   list(a__       )
        snake_case :			Dict							=   list(a__       )
        snake_case :			str							=   conv_bias
        snake_case :			Dict							=   num_conv_pos_embeddings
        snake_case :			Union[str, Any]							=   num_conv_pos_embedding_groups
        snake_case :			Optional[int]							=   len(self.conv_dim       )
        snake_case :			Tuple							=   num_hidden_layers
        snake_case :			Any							=   intermediate_size
        snake_case :			Optional[Any]							=   hidden_act
        snake_case :			str							=   num_attention_heads
        snake_case :			List[Any]							=   hidden_dropout
        snake_case :			Union[str, Any]							=   attention_dropout
        snake_case :			Dict							=   activation_dropout
        snake_case :			List[str]							=   feat_proj_layer_norm
        snake_case :			List[str]							=   feat_proj_dropout
        snake_case :			Union[str, Any]							=   final_dropout
        snake_case :			List[str]							=   layerdrop
        snake_case :			str							=   layer_norm_eps
        snake_case :			Tuple							=   initializer_range
        snake_case :			str							=   vocab_size
        snake_case :			Tuple							=   do_stable_layer_norm
        snake_case :			Dict							=   use_weighted_layer_sum
        snake_case :			Optional[Any]							=   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
        snake_case :			Optional[int]							=   apply_spec_augment
        snake_case :			int							=   mask_time_prob
        snake_case :			Dict							=   mask_time_length
        snake_case :			Any							=   mask_time_min_masks
        snake_case :			Any							=   mask_feature_prob
        snake_case :			Union[str, Any]							=   mask_feature_length
        snake_case :			List[Any]							=   mask_feature_min_masks

        # ctc loss
        snake_case :			List[str]							=   ctc_loss_reduction
        snake_case :			Dict							=   ctc_zero_infinity



       @property
       def 					UpperCAmelCase					(      self       ):






        '''simple docstring'''






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






