


import functools
import operator

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


_A		:					Union[str, Any]          =							logging.get_logger(__name__)

_A		:					List[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 							a       (      _UpperCAmelCase ):
     UpperCAmelCase__			:	Tuple       =						"hubert"





     def __init__(     self       :					Dict     ,						SCREAMING_SNAKE_CASE_       :					Optional[int]=32     ,						SCREAMING_SNAKE_CASE_       :					List[str]=768     ,						SCREAMING_SNAKE_CASE_       :					List[Any]=12     ,						SCREAMING_SNAKE_CASE_       :					Dict=12     ,						SCREAMING_SNAKE_CASE_       :					List[str]=3072     ,						SCREAMING_SNAKE_CASE_       :					str="gelu"     ,						SCREAMING_SNAKE_CASE_       :					List[str]=0.1     ,						SCREAMING_SNAKE_CASE_       :					Union[str, Any]=0.1     ,						SCREAMING_SNAKE_CASE_       :					Optional[int]=0.1     ,						SCREAMING_SNAKE_CASE_       :					Any=True     ,						SCREAMING_SNAKE_CASE_       :					Optional[int]=0.0     ,						SCREAMING_SNAKE_CASE_       :					Optional[Any]=0.1     ,						SCREAMING_SNAKE_CASE_       :					Optional[Any]=0.1     ,						SCREAMING_SNAKE_CASE_       :					int=0.02     ,						SCREAMING_SNAKE_CASE_       :					Optional[Any]=1E-5     ,						SCREAMING_SNAKE_CASE_       :					int="group"     ,						SCREAMING_SNAKE_CASE_       :					Tuple="gelu"     ,						SCREAMING_SNAKE_CASE_       :					Any=(512, 512, 512, 512, 512, 512, 512)     ,						SCREAMING_SNAKE_CASE_       :					Optional[int]=(5, 2, 2, 2, 2, 2, 2)     ,						SCREAMING_SNAKE_CASE_       :					Tuple=(10, 3, 3, 3, 3, 2, 2)     ,						SCREAMING_SNAKE_CASE_       :					Optional[int]=False     ,						SCREAMING_SNAKE_CASE_       :					Dict=128     ,						SCREAMING_SNAKE_CASE_       :					Dict=16     ,						SCREAMING_SNAKE_CASE_       :					Any=False     ,						SCREAMING_SNAKE_CASE_       :					List[str]=True     ,						SCREAMING_SNAKE_CASE_       :					List[str]=0.05     ,						SCREAMING_SNAKE_CASE_       :					List[str]=10     ,						SCREAMING_SNAKE_CASE_       :					str=2     ,						SCREAMING_SNAKE_CASE_       :					List[Any]=0.0     ,						SCREAMING_SNAKE_CASE_       :					Union[str, Any]=10     ,						SCREAMING_SNAKE_CASE_       :					Union[str, Any]=0     ,						SCREAMING_SNAKE_CASE_       :					Dict="sum"     ,						SCREAMING_SNAKE_CASE_       :					Optional[Any]=False     ,						SCREAMING_SNAKE_CASE_       :					int=False     ,						SCREAMING_SNAKE_CASE_       :					Any=256     ,						SCREAMING_SNAKE_CASE_       :					str=0     ,						SCREAMING_SNAKE_CASE_       :					Union[str, Any]=1     ,						SCREAMING_SNAKE_CASE_       :					Any=2     ,						**SCREAMING_SNAKE_CASE_       :					Optional[int]     ,						):
        super().__init__(**lowercase__     ,						pad_token_id=lowercase__     ,						bos_token_id=lowercase__     ,						eos_token_id=lowercase__				)
        __lowerCamelCase:					Tuple	 =						hidden_size
        __lowerCamelCase:					Any	 =						feat_extract_norm
        __lowerCamelCase:					Tuple	 =						feat_extract_activation
        __lowerCamelCase:					Optional[Any]	 =						list(lowercase__				)
        __lowerCamelCase:					Optional[int]	 =						list(lowercase__				)
        __lowerCamelCase:					int	 =						list(lowercase__				)
        __lowerCamelCase:					str	 =						conv_bias
        __lowerCamelCase:					List[Any]	 =						num_conv_pos_embeddings
        __lowerCamelCase:					Tuple	 =						num_conv_pos_embedding_groups
        __lowerCamelCase:					Any	 =						len(self.conv_dim				)
        __lowerCamelCase:					Any	 =						num_hidden_layers
        __lowerCamelCase:					Union[str, Any]	 =						intermediate_size
        __lowerCamelCase:					Optional[int]	 =						hidden_act
        __lowerCamelCase:					Optional[Any]	 =						num_attention_heads
        __lowerCamelCase:					int	 =						hidden_dropout
        __lowerCamelCase:					Any	 =						attention_dropout
        __lowerCamelCase:					Any	 =						activation_dropout
        __lowerCamelCase:					Union[str, Any]	 =						feat_proj_layer_norm
        __lowerCamelCase:					Tuple	 =						feat_proj_dropout
        __lowerCamelCase:					Tuple	 =						final_dropout
        __lowerCamelCase:					List[Any]	 =						layerdrop
        __lowerCamelCase:					str	 =						layer_norm_eps
        __lowerCamelCase:					List[str]	 =						initializer_range
        __lowerCamelCase:					Optional[int]	 =						vocab_size
        __lowerCamelCase:					Union[str, Any]	 =						do_stable_layer_norm
        __lowerCamelCase:					Optional[int]	 =						use_weighted_layer_sum
        __lowerCamelCase:					Optional[int]	 =						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:					int	 =						apply_spec_augment
        __lowerCamelCase:					str	 =						mask_time_prob
        __lowerCamelCase:					Tuple	 =						mask_time_length
        __lowerCamelCase:					Optional[Any]	 =						mask_time_min_masks
        __lowerCamelCase:					int	 =						mask_feature_prob
        __lowerCamelCase:					Optional[int]	 =						mask_feature_length
        __lowerCamelCase:					str	 =						mask_feature_min_masks

        # ctc loss
        __lowerCamelCase:					Union[str, Any]	 =						ctc_loss_reduction
        __lowerCamelCase:					List[Any]	 =						ctc_zero_infinity







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




"""simple docstring"""




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


snake_case					  =						{'configuration_qdqbert': ['QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'QDQBertConfig']}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	snake_case					  =						[
	    'QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'QDQBertForMaskedLM',
	    'QDQBertForMultipleChoice',
	    'QDQBertForNextSentencePrediction',
	    'QDQBertForQuestionAnswering',
	    'QDQBertForSequenceClassification',
	    'QDQBertForTokenClassification',
	    'QDQBertLayer',
	    'QDQBertLMHeadModel',
	    'QDQBertModel',
	    'QDQBertPreTrainedModel',
	    'load_tf_weights_in_qdqbert',
	]


if TYPE_CHECKING:
	from .configuration_qdqbert import QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, QDQBertConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_qdqbert import (
		    QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    QDQBertForMaskedLM,
		    QDQBertForMultipleChoice,
		    QDQBertForNextSentencePrediction,
		    QDQBertForQuestionAnswering,
		    QDQBertForSequenceClassification,
		    QDQBertForTokenClassification,
		    QDQBertLayer,
		    QDQBertLMHeadModel,
		    QDQBertModel,
		    QDQBertPreTrainedModel,
		    load_tf_weights_in_qdqbert,
		)


else:
	import sys

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