"""simple docstring"""






import functools
import operator

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


UpperCamelCase     					=     logging.get_logger(__name__)

UpperCamelCase     					=     {
    '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   UpperCAmelCase__				(    __lowerCamelCase			):


	"""simple docstring"""
	lowerCAmelCase__    :					Optional[Any]						      =							"""hubert"""







	def __init__(			self       ,     _SCREAMING_SNAKE_CASE=3_2       ,     _SCREAMING_SNAKE_CASE=7_6_8       ,     _SCREAMING_SNAKE_CASE=1_2       ,     _SCREAMING_SNAKE_CASE=1_2       ,     _SCREAMING_SNAKE_CASE=3_0_7_2       ,     _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.0_2       ,     _SCREAMING_SNAKE_CASE=1E-5       ,     _SCREAMING_SNAKE_CASE="group"       ,     _SCREAMING_SNAKE_CASE="gelu"       ,     _SCREAMING_SNAKE_CASE=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)       ,     _SCREAMING_SNAKE_CASE=(5, 2, 2, 2, 2, 2, 2)       ,     _SCREAMING_SNAKE_CASE=(1_0, 3, 3, 3, 3, 2, 2)       ,     _SCREAMING_SNAKE_CASE=False       ,     _SCREAMING_SNAKE_CASE=1_2_8       ,     _SCREAMING_SNAKE_CASE=1_6       ,     _SCREAMING_SNAKE_CASE=False       ,     _SCREAMING_SNAKE_CASE=True       ,     _SCREAMING_SNAKE_CASE=0.0_5       ,     _SCREAMING_SNAKE_CASE=1_0       ,     _SCREAMING_SNAKE_CASE=2       ,     _SCREAMING_SNAKE_CASE=0.0       ,     _SCREAMING_SNAKE_CASE=1_0       ,     _SCREAMING_SNAKE_CASE=0       ,     _SCREAMING_SNAKE_CASE="sum"       ,     _SCREAMING_SNAKE_CASE=False       ,     _SCREAMING_SNAKE_CASE=False       ,     _SCREAMING_SNAKE_CASE=2_5_6       ,     _SCREAMING_SNAKE_CASE=0       ,     _SCREAMING_SNAKE_CASE=1       ,     _SCREAMING_SNAKE_CASE=2       ,     **_SCREAMING_SNAKE_CASE       ,     )    ->	str:
							super().__init__(**_SCREAMING_SNAKE_CASE       ,     pad_token_id=_SCREAMING_SNAKE_CASE       ,     bos_token_id=_SCREAMING_SNAKE_CASE       ,     eos_token_id=_SCREAMING_SNAKE_CASE )
							a_							:			Optional[int]     		=					hidden_size
							a_							:			Any     		=					feat_extract_norm
							a_							:			Union[str, Any]     		=					feat_extract_activation
							a_							:			str     		=					list(_SCREAMING_SNAKE_CASE )
							a_							:			Tuple     		=					list(_SCREAMING_SNAKE_CASE )
							a_							:			Optional[Any]     		=					list(_SCREAMING_SNAKE_CASE )
							a_							:			Dict     		=					conv_bias
							a_							:			Dict     		=					num_conv_pos_embeddings
							a_							:			Any     		=					num_conv_pos_embedding_groups
							a_							:			Any     		=					len(self.conv_dim )
							a_							:			List[str]     		=					num_hidden_layers
							a_							:			List[str]     		=					intermediate_size
							a_							:			Optional[int]     		=					hidden_act
							a_							:			Optional[Any]     		=					num_attention_heads
							a_							:			List[Any]     		=					hidden_dropout
							a_							:			List[str]     		=					attention_dropout
							a_							:			Tuple     		=					activation_dropout
							a_							:			Any     		=					feat_proj_layer_norm
							a_							:			Union[str, Any]     		=					feat_proj_dropout
							a_							:			Dict     		=					final_dropout
							a_							:			List[str]     		=					layerdrop
							a_							:			str     		=					layer_norm_eps
							a_							:			Dict     		=					initializer_range
							a_							:			Union[str, Any]     		=					vocab_size
							a_							:			Tuple     		=					do_stable_layer_norm
							a_							:			List[str]     		=					use_weighted_layer_sum
							a_							:			List[str]     		=					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_							:			Tuple     		=					apply_spec_augment
							a_							:			Any     		=					mask_time_prob
							a_							:			List[Any]     		=					mask_time_length
							a_							:			int     		=					mask_time_min_masks
							a_							:			List[Any]     		=					mask_feature_prob
							a_							:			Optional[Any]     		=					mask_feature_length
							a_							:			List[str]     		=					mask_feature_min_masks

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







	@property
	def       A    (			self )    ->	Optional[int]:
							return functools.reduce(operator.mul       ,     self.conv_stride       ,     1 )





"""simple docstring"""






def  lowerCAmelCase_      (_SCREAMING_SNAKE_CASE	:str  )				-> int:
						a_							:			Optional[int]     		=					0
						for letter in data:
												a_							:			Union[str, Any]     		=					(hash_ << 4) + ord(_SCREAMING_SNAKE_CASE  )
												a_							:			Optional[int]     		=					hash_ & 0xf000_0000
												if x != 0:
																		hash_ ^= x >> 24
												hash_ &= ~x
						return hash_


if __name__ == "__main__":
				import doctest

				doctest.testmod()




