






import functools
import operator

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


SCREAMING_SNAKE_CASE__   :      List[Any]				=		logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__   :      int				=		{
    """asapp/sew-tiny-100k""": """https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json""",
    # See all SEW models at https://huggingface.co/models?filter=sew
}
class     lowerCamelCase_					(   lowerCamelCase			):
				a__       							=	'''sew'''







				def __init__(    self							,       __lowerCAmelCase=3_2							,       __lowerCAmelCase=7_6_8							,       __lowerCAmelCase=1_2							,       __lowerCAmelCase=1_2							,       __lowerCAmelCase=3_0_7_2							,       __lowerCAmelCase=2							,       __lowerCAmelCase="gelu"							,       __lowerCAmelCase=0.1							,       __lowerCAmelCase=0.1							,       __lowerCAmelCase=0.1							,       __lowerCAmelCase=0.0							,       __lowerCAmelCase=0.1							,       __lowerCAmelCase=0.1							,       __lowerCAmelCase=0.02							,       __lowerCAmelCase=1E-5							,       __lowerCAmelCase="group"							,       __lowerCAmelCase="gelu"							,       __lowerCAmelCase=(6_4, 1_2_8, 1_2_8, 1_2_8, 1_2_8, 2_5_6, 2_5_6, 2_5_6, 2_5_6, 5_1_2, 5_1_2, 5_1_2, 5_1_2)							,       __lowerCAmelCase=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)							,       __lowerCAmelCase=(1_0, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)							,       __lowerCAmelCase=False							,       __lowerCAmelCase=1_2_8							,       __lowerCAmelCase=1_6							,       __lowerCAmelCase=True							,       __lowerCAmelCase=0.05							,       __lowerCAmelCase=1_0							,       __lowerCAmelCase=2							,       __lowerCAmelCase=0.0							,       __lowerCAmelCase=1_0							,       __lowerCAmelCase=0							,       __lowerCAmelCase="mean"							,       __lowerCAmelCase=False							,       __lowerCAmelCase=False							,       __lowerCAmelCase=2_5_6							,       __lowerCAmelCase=0							,       __lowerCAmelCase=1							,       __lowerCAmelCase=2							,       **__lowerCAmelCase							,       ):
								"""simple docstring"""
								super().__init__(**__lowerCAmelCase							,       pad_token_id=__lowerCAmelCase							,       bos_token_id=__lowerCAmelCase							,       eos_token_id=__lowerCAmelCase  )
								__magic_name__		:Optional[Any]   =   hidden_size
								__magic_name__		:str   =   feat_extract_norm
								__magic_name__		:str   =   feat_extract_activation
								__magic_name__		:Tuple   =   list(__lowerCAmelCase  )
								__magic_name__		:int   =   list(__lowerCAmelCase  )
								__magic_name__		:Any   =   list(__lowerCAmelCase  )
								__magic_name__		:Tuple   =   conv_bias
								__magic_name__		:Union[str, Any]   =   num_conv_pos_embeddings
								__magic_name__		:str   =   num_conv_pos_embedding_groups
								__magic_name__		:List[Any]   =   len(self.conv_dim  )
								__magic_name__		:Dict   =   num_hidden_layers
								__magic_name__		:Union[str, Any]   =   intermediate_size
								__magic_name__		:List[Any]   =   squeeze_factor
								__magic_name__		:Tuple   =   hidden_act
								__magic_name__		:int   =   num_attention_heads
								__magic_name__		:Union[str, Any]   =   hidden_dropout
								__magic_name__		:Dict   =   attention_dropout
								__magic_name__		:Any   =   activation_dropout
								__magic_name__		:Union[str, Any]   =   feat_proj_dropout
								__magic_name__		:Union[str, Any]   =   final_dropout
								__magic_name__		:Optional[Any]   =   layerdrop
								__magic_name__		:List[Any]   =   layer_norm_eps
								__magic_name__		:Union[str, Any]   =   initializer_range
								__magic_name__		:List[str]   =   vocab_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)`,'''
												    F'''but is `len(config.conv_dim) = {len(self.conv_dim  )}`, `len(config.conv_stride)'''
												    F'''= {len(self.conv_stride  )}`, `len(config.conv_kernel) = {len(self.conv_kernel  )}`.'''  )

								# fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
								__magic_name__		:Any   =   apply_spec_augment
								__magic_name__		:Union[str, Any]   =   mask_time_prob
								__magic_name__		:Union[str, Any]   =   mask_time_length
								__magic_name__		:str   =   mask_time_min_masks
								__magic_name__		:Optional[int]   =   mask_feature_prob
								__magic_name__		:Tuple   =   mask_feature_length
								__magic_name__		:List[Any]   =   mask_feature_min_masks

								# ctc loss
								__magic_name__		:Any   =   ctc_loss_reduction
								__magic_name__		:Optional[int]   =   ctc_zero_infinity

								# sequence classification
								__magic_name__		:Optional[Any]   =   use_weighted_layer_sum
								__magic_name__		:List[Any]   =   classifier_proj_size







				@property
				def       A						(    self  ):
								"""simple docstring"""
								return functools.reduce(operator.mul							,       self.conv_stride							,       1  )














def   __lowercase       (			snake_case			):







				"""simple docstring"""






				if not isinstance(snake_case,	snake_case			):
								raise ValueError('''multiplicative_persistence() only accepts integral values'''			)
				if num < 0:
								raise ValueError('''multiplicative_persistence() does not accept negative values'''			)

				__magic_name__		:str   =   0
				__magic_name__		:Dict   =   str(snake_case			)

				while len(snake_case			) != 1:
								__magic_name__		:Optional[Any]   =   [int(snake_case			) for i in num_string]

								__magic_name__		:Dict   =   1
								for i in range(0,	len(snake_case			)			):
												total *= numbers[i]

								__magic_name__		:int   =   str(snake_case			)

								steps += 1
				return steps

def   __lowercase       (			snake_case			):







				"""simple docstring"""






				if not isinstance(snake_case,	snake_case			):
								raise ValueError('''additive_persistence() only accepts integral values'''			)
				if num < 0:
								raise ValueError('''additive_persistence() does not accept negative values'''			)

				__magic_name__		:str   =   0
				__magic_name__		:Union[str, Any]   =   str(snake_case			)

				while len(snake_case			) != 1:
								__magic_name__		:str   =   [int(snake_case			) for i in num_string]

								__magic_name__		:Optional[int]   =   0
								for i in range(0,	len(snake_case			)			):
												total += numbers[i]

								__magic_name__		:int   =   str(snake_case			)

								steps += 1
				return steps


if __name__ == "__main__":
					import doctest

					doctest.testmod()






