



import functools
import operator

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


A_		:  str										=  logging.get_logger(__name__)

A_		:  Dict										=  {
    '''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__						):
   _UpperCAmelCase  						=      '''hubert'''

   def __init__(   self      :							Optional[Any]				, __lowerCAmelCase      :							str=32				, __lowerCAmelCase      :							int=768				, __lowerCAmelCase      :							Optional[int]=12				, __lowerCAmelCase      :							List[Any]=12				, __lowerCAmelCase      :							Optional[Any]=3072				, __lowerCAmelCase      :							Tuple="gelu"				, __lowerCAmelCase      :							Dict=0.1				, __lowerCAmelCase      :							List[Any]=0.1				, __lowerCAmelCase      :							str=0.1				, __lowerCAmelCase      :							Union[str, Any]=True				, __lowerCAmelCase      :							Tuple=0.0				, __lowerCAmelCase      :							Optional[int]=0.1				, __lowerCAmelCase      :							List[str]=0.1				, __lowerCAmelCase      :							Dict=0.0_2				, __lowerCAmelCase      :							Any=1E-5				, __lowerCAmelCase      :							Optional[Any]="group"				, __lowerCAmelCase      :							int="gelu"				, __lowerCAmelCase      :							Dict=(512, 512, 512, 512, 512, 512, 512)				, __lowerCAmelCase      :							Tuple=(5, 2, 2, 2, 2, 2, 2)				, __lowerCAmelCase      :							Tuple=(10, 3, 3, 3, 3, 2, 2)				, __lowerCAmelCase      :							Tuple=False				, __lowerCAmelCase      :							Any=128				, __lowerCAmelCase      :							Tuple=16				, __lowerCAmelCase      :							Tuple=False				, __lowerCAmelCase      :							int=True				, __lowerCAmelCase      :							List[str]=0.0_5				, __lowerCAmelCase      :							List[str]=10				, __lowerCAmelCase      :							int=2				, __lowerCAmelCase      :							List[Any]=0.0				, __lowerCAmelCase      :							Dict=10				, __lowerCAmelCase      :							List[str]=0				, __lowerCAmelCase      :							Union[str, Any]="sum"				, __lowerCAmelCase      :							Dict=False				, __lowerCAmelCase      :							List[str]=False				, __lowerCAmelCase      :							int=256				, __lowerCAmelCase      :							List[str]=0				, __lowerCAmelCase      :							str=1				, __lowerCAmelCase      :							Any=2				, **__lowerCAmelCase      :							Tuple				, )							->					Tuple:


    """simple docstring"""






    super().__init__(**__lowerCAmelCase				, pad_token_id=__lowerCAmelCase				, bos_token_id=__lowerCAmelCase				, eos_token_id=__lowerCAmelCase				)
    a							=		hidden_size
    a							=		feat_extract_norm
    a							=		feat_extract_activation
    a							=		list(__lowerCAmelCase				)
    a							=		list(__lowerCAmelCase				)
    a							=		list(__lowerCAmelCase				)
    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 		A				(   self      :							Tuple				)							->					Optional[Any]:


    """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, is_vision_available


lowercase		:    Dict			=       {
    'configuration_mobilenet_v1': [
        'MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'MobileNetV1Config',
        'MobileNetV1OnnxConfig',
    ],
}

try:
			if not is_vision_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowercase		:    Optional[int]			=       ['MobileNetV1FeatureExtractor']
			lowercase		:    Union[str, Any]			=       ['MobileNetV1ImageProcessor']

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowercase		:    Tuple			=       [
			    'MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'MobileNetV1ForImageClassification',
			    'MobileNetV1Model',
			    'MobileNetV1PreTrainedModel',
			    'load_tf_weights_in_mobilenet_v1',
			]


if TYPE_CHECKING:
			from .configuration_mobilenet_va import (
			    MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP,
			    MobileNetVaConfig,
			    MobileNetVaOnnxConfig,
			)

			try:
						if not is_vision_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .feature_extraction_mobilenet_va import MobileNetVaFeatureExtractor
						from .image_processing_mobilenet_va import MobileNetVaImageProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_mobilenet_va import (
						    MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST,
						    MobileNetVaForImageClassification,
						    MobileNetVaModel,
						    MobileNetVaPreTrainedModel,
						    load_tf_weights_in_mobilenet_va,
						)


else:
			import sys

			lowercase		:    Union[str, Any]			=       _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
