


import functools
import operator

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


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

A				:       List[Any]      =  {
    'asapp/sew-d-tiny-100k': 'https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json',
    # See all SEW-D models at https://huggingface.co/models?filter=sew-d
}






class      UpperCamelCase(	_a ):
					snake_case_		:					Union[str, Any]    					=						"""sew-d"""


					def __init__(    self						:		int  ,     SCREAMING_SNAKE_CASE						:		Tuple=3_2  ,     SCREAMING_SNAKE_CASE						:		Any=7_6_8  ,     SCREAMING_SNAKE_CASE						:		Tuple=1_2  ,     SCREAMING_SNAKE_CASE						:		Any=1_2  ,     SCREAMING_SNAKE_CASE						:		List[Any]=3_0_7_2  ,     SCREAMING_SNAKE_CASE						:		Optional[Any]=2  ,     SCREAMING_SNAKE_CASE						:		str=5_1_2  ,     SCREAMING_SNAKE_CASE						:		Dict=2_5_6  ,     SCREAMING_SNAKE_CASE						:		Optional[int]=True  ,     SCREAMING_SNAKE_CASE						:		List[str]=True  ,     SCREAMING_SNAKE_CASE						:		Dict=("p2c", "c2p")  ,     SCREAMING_SNAKE_CASE						:		str="layer_norm"  ,     SCREAMING_SNAKE_CASE						:		Union[str, Any]="gelu_python"  ,     SCREAMING_SNAKE_CASE						:		Any=0.1  ,     SCREAMING_SNAKE_CASE						:		Optional[Any]=0.1  ,     SCREAMING_SNAKE_CASE						:		Any=0.1  ,     SCREAMING_SNAKE_CASE						:		List[Any]=0.0  ,     SCREAMING_SNAKE_CASE						:		List[str]=0.1  ,     SCREAMING_SNAKE_CASE						:		Optional[Any]=0.02  ,     SCREAMING_SNAKE_CASE						:		Union[str, Any]=1e-7  ,     SCREAMING_SNAKE_CASE						:		str=1e-5  ,     SCREAMING_SNAKE_CASE						:		Optional[Any]="group"  ,     SCREAMING_SNAKE_CASE						:		Optional[Any]="gelu"  ,     SCREAMING_SNAKE_CASE						:		Union[str, Any]=(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)  ,     SCREAMING_SNAKE_CASE						:		Optional[Any]=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)  ,     SCREAMING_SNAKE_CASE						:		Optional[int]=(1_0, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)  ,     SCREAMING_SNAKE_CASE						:		Dict=False  ,     SCREAMING_SNAKE_CASE						:		int=1_2_8  ,     SCREAMING_SNAKE_CASE						:		str=1_6  ,     SCREAMING_SNAKE_CASE						:		int=True  ,     SCREAMING_SNAKE_CASE						:		Any=0.05  ,     SCREAMING_SNAKE_CASE						:		Any=1_0  ,     SCREAMING_SNAKE_CASE						:		List[str]=2  ,     SCREAMING_SNAKE_CASE						:		Dict=0.0  ,     SCREAMING_SNAKE_CASE						:		Any=1_0  ,     SCREAMING_SNAKE_CASE						:		Optional[Any]=0  ,     SCREAMING_SNAKE_CASE						:		str="mean"  ,     SCREAMING_SNAKE_CASE						:		List[Any]=False  ,     SCREAMING_SNAKE_CASE						:		str=False  ,     SCREAMING_SNAKE_CASE						:		List[str]=2_5_6  ,     SCREAMING_SNAKE_CASE						:		Tuple=0  ,     SCREAMING_SNAKE_CASE						:		Optional[Any]=1  ,     SCREAMING_SNAKE_CASE						:		Optional[Any]=2  ,     **SCREAMING_SNAKE_CASE						:		Optional[int]  ,     )      ->						List[Any]:




											'''simple docstring'''

											super().__init__(**SCREAMING_SNAKE_CASE  ,     pad_token_id=SCREAMING_SNAKE_CASE  ,     bos_token_id=SCREAMING_SNAKE_CASE  ,     eos_token_id=SCREAMING_SNAKE_CASE    )
											__snake_case				=		hidden_size
											__snake_case				=		feat_extract_norm
											__snake_case				=		feat_extract_activation
											__snake_case				=		list(SCREAMING_SNAKE_CASE    )
											__snake_case				=		list(SCREAMING_SNAKE_CASE    )
											__snake_case				=		list(SCREAMING_SNAKE_CASE    )
											__snake_case				=		conv_bias
											__snake_case				=		num_conv_pos_embeddings
											__snake_case				=		num_conv_pos_embedding_groups
											__snake_case				=		len(self.conv_dim    )
											__snake_case				=		num_hidden_layers
											__snake_case				=		intermediate_size
											__snake_case				=		squeeze_factor
											__snake_case				=		max_position_embeddings
											__snake_case				=		position_buckets
											__snake_case				=		share_att_key
											__snake_case				=		relative_attention
											__snake_case				=		norm_rel_ebd
											__snake_case				=		list(SCREAMING_SNAKE_CASE    )
											__snake_case				=		hidden_act
											__snake_case				=		num_attention_heads
											__snake_case				=		hidden_dropout
											__snake_case				=		attention_dropout
											__snake_case				=		activation_dropout
											__snake_case				=		feat_proj_dropout
											__snake_case				=		final_dropout
											__snake_case				=		layer_norm_eps
											__snake_case				=		feature_layer_norm_eps
											__snake_case				=		initializer_range
											__snake_case				=		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
											__snake_case				=		apply_spec_augment
											__snake_case				=		mask_time_prob
											__snake_case				=		mask_time_length
											__snake_case				=		mask_time_min_masks
											__snake_case				=		mask_feature_prob
											__snake_case				=		mask_feature_length
											__snake_case				=		mask_feature_min_masks

											# ctc loss
											__snake_case				=		ctc_loss_reduction
											__snake_case				=		ctc_zero_infinity

											# sequence classification
											__snake_case				=		use_weighted_layer_sum
											__snake_case				=		classifier_proj_size






					@property
					def 				SCREAMING_SNAKE_CASE_	(    self						:		List[Any]    )      ->						str:




											'''simple docstring'''

											return functools.reduce(operator.mul  ,     self.conv_stride  ,     1    )









import baseaa





def 						_lowerCAmelCase							(     _lowerCAmelCase			)    ->						bytes:


						'''simple docstring'''






						return baseaa.baaencode(string.encode("utf-8"			)			)





def 						_lowerCAmelCase							(     _lowerCAmelCase			)    ->						str:


						'''simple docstring'''






						return baseaa.baadecode(_lowerCAmelCase			).decode("utf-8"			)


if __name__ == "__main__":
	A				:       Dict      =  'Hello World!'
	A				:       Any      =  baseaa_encode(test)
	print(encoded)

	A				:       Optional[int]      =  baseaa_decode(encoded)
	print(decoded)





