
import functools
import operator

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


__magic_name__           =					logging.get_logger(__name__)

__magic_name__           =					{
    '''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	):
      _A  :						List[Any]      		=       'hubert'
      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=True						,		lowerCamelCase=0.0						,		lowerCamelCase=0.1						,		lowerCamelCase=0.1						,		lowerCamelCase=0.0_2						,		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.0_5						,		lowerCamelCase=10						,		lowerCamelCase=2						,		lowerCamelCase=0.0						,		lowerCamelCase=10						,		lowerCamelCase=0						,		lowerCamelCase="sum"						,		lowerCamelCase=False						,		lowerCamelCase=False						,		lowerCamelCase=2_56						,		lowerCamelCase=0						,		lowerCamelCase=1						,		lowerCamelCase=2						,		**lowerCamelCase						,		):
          super().__init__(**lowerCamelCase						,		pad_token_id=lowerCamelCase						,		bos_token_id=lowerCamelCase						,		eos_token_id=lowerCamelCase	)
          snake_case__  =			hidden_size
          snake_case__  =			feat_extract_norm
          snake_case__  =			feat_extract_activation
          snake_case__  =			list(lowerCamelCase	)
          snake_case__  =			list(lowerCamelCase	)
          snake_case__  =			list(lowerCamelCase	)
          snake_case__  =			conv_bias
          snake_case__  =			num_conv_pos_embeddings
          snake_case__  =			num_conv_pos_embedding_groups
          snake_case__  =			len(self.conv_dim	)
          snake_case__  =			num_hidden_layers
          snake_case__  =			intermediate_size
          snake_case__  =			hidden_act
          snake_case__  =			num_attention_heads
          snake_case__  =			hidden_dropout
          snake_case__  =			attention_dropout
          snake_case__  =			activation_dropout
          snake_case__  =			feat_proj_layer_norm
          snake_case__  =			feat_proj_dropout
          snake_case__  =			final_dropout
          snake_case__  =			layerdrop
          snake_case__  =			layer_norm_eps
          snake_case__  =			initializer_range
          snake_case__  =			vocab_size
          snake_case__  =			do_stable_layer_norm
          snake_case__  =			use_weighted_layer_sum
          snake_case__  =			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__  =			apply_spec_augment
          snake_case__  =			mask_time_prob
          snake_case__  =			mask_time_length
          snake_case__  =			mask_time_min_masks
          snake_case__  =			mask_feature_prob
          snake_case__  =			mask_feature_length
          snake_case__  =			mask_feature_min_masks

          # ctc loss
          snake_case__  =			ctc_loss_reduction
          snake_case__  =			ctc_zero_infinity



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





# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


__magic_name__           =					{
    '''configuration_convnextv2''': [
        '''CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''ConvNextV2Config''',
    ]
}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     __magic_name__           =					[
         '''CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''ConvNextV2ForImageClassification''',
         '''ConvNextV2Model''',
         '''ConvNextV2PreTrainedModel''',
         '''ConvNextV2Backbone''',
     ]


if TYPE_CHECKING:
     from .configuration_convnextva import (
         CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP,
         ConvNextVaConfig,
     )

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_convnextva import (
              CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST,
              ConvNextVaBackbone,
              ConvNextVaForImageClassification,
              ConvNextVaModel,
              ConvNextVaPreTrainedModel,
          )

else:
     import sys

     __magic_name__           =					_LazyModule(__name__, globals()['''__file__'''], _import_structure)



