



'''simple docstring'''




def  __lowerCamelCase    (   _lowercase      ,							_lowercase						) ->     List[Any]:
							UpperCAmelCase	:						Optional[int]					=						1
							while b > 0:
														if b & 1:
																					res *= a

														a *= a
														b >>= 1

							return res



def  __lowerCamelCase    (   _lowercase      ,							_lowercase      ,							_lowercase						) ->     Optional[int]:
							UpperCAmelCase	:						Any					=						1
							while b > 0:
														if b & 1:
																					UpperCAmelCase	:						Optional[Any]					=						((res % c) * (a % c)) % c

														a *= a
														b >>= 1

							return res






'''simple docstring'''




import functools
import operator

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


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

a  :     int       =       {
    """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_					(				__magic_name__     ):
	lowercase		=					'hubert'





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

								# ctc loss
								UpperCAmelCase	:						int					=						ctc_loss_reduction
								UpperCAmelCase	:						Any					=						ctc_zero_infinity






	@property
	def 					_lowercase(    self       )     ->     Union[str, Any]:
								return functools.reduce(operator.mul						,						self.conv_stride						,						1       )

