






import functools
import operator

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


UpperCAmelCase_ :						Optional[Any]      =      logging.get_logger(__name__)

UpperCAmelCase_ :						Tuple      =      {
    '''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     _SCREAMING_SNAKE_CASE       (			_a      ):
	snake_case__							:     Union[str, Any]     	=  """sew-d"""





	def __init__(		self				:					List[str] ,  __lowerCamelCase				:					str=32 ,  __lowerCamelCase				:					Dict=768 ,  __lowerCamelCase				:					List[Any]=12 ,  __lowerCamelCase				:					Optional[Any]=12 ,  __lowerCamelCase				:					str=3_072 ,  __lowerCamelCase				:					Dict=2 ,  __lowerCamelCase				:					Dict=512 ,  __lowerCamelCase				:					Dict=256 ,  __lowerCamelCase				:					List[str]=True ,  __lowerCamelCase				:					str=True ,  __lowerCamelCase				:					Any=("p2c", "c2p") ,  __lowerCamelCase				:					Tuple="layer_norm" ,  __lowerCamelCase				:					Dict="gelu_python" ,  __lowerCamelCase				:					str=0.1 ,  __lowerCamelCase				:					Tuple=0.1 ,  __lowerCamelCase				:					Any=0.1 ,  __lowerCamelCase				:					List[Any]=0.0 ,  __lowerCamelCase				:					Optional[Any]=0.1 ,  __lowerCamelCase				:					str=0.02 ,  __lowerCamelCase				:					str=1E-7 ,  __lowerCamelCase				:					Union[str, Any]=1E-5 ,  __lowerCamelCase				:					List[str]="group" ,  __lowerCamelCase				:					List[str]="gelu" ,  __lowerCamelCase				:					Tuple=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512) ,  __lowerCamelCase				:					Optional[int]=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1) ,  __lowerCamelCase				:					Dict=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1) ,  __lowerCamelCase				:					Tuple=False ,  __lowerCamelCase				:					Tuple=128 ,  __lowerCamelCase				:					str=16 ,  __lowerCamelCase				:					Optional[int]=True ,  __lowerCamelCase				:					List[str]=0.05 ,  __lowerCamelCase				:					List[Any]=10 ,  __lowerCamelCase				:					Union[str, Any]=2 ,  __lowerCamelCase				:					Dict=0.0 ,  __lowerCamelCase				:					Any=10 ,  __lowerCamelCase				:					Union[str, Any]=0 ,  __lowerCamelCase				:					Union[str, Any]="mean" ,  __lowerCamelCase				:					List[str]=False ,  __lowerCamelCase				:					int=False ,  __lowerCamelCase				:					Any=256 ,  __lowerCamelCase				:					Tuple=0 ,  __lowerCamelCase				:					Tuple=1 ,  __lowerCamelCase				:					Union[str, Any]=2 ,  **__lowerCamelCase				:					Any ,  ):
		super().__init__(**snake_case_ ,  pad_token_id=snake_case_ ,  bos_token_id=snake_case_ ,  eos_token_id=snake_case_	)
		UpperCamelCase     :List[str]          =	hidden_size
		UpperCamelCase     :Optional[int]          =	feat_extract_norm
		UpperCamelCase     :str          =	feat_extract_activation
		UpperCamelCase     :List[Any]          =	list(snake_case_	)
		UpperCamelCase     :Dict          =	list(snake_case_	)
		UpperCamelCase     :Optional[int]          =	list(snake_case_	)
		UpperCamelCase     :List[str]          =	conv_bias
		UpperCamelCase     :Any          =	num_conv_pos_embeddings
		UpperCamelCase     :Dict          =	num_conv_pos_embedding_groups
		UpperCamelCase     :Dict          =	len(self.conv_dim	)
		UpperCamelCase     :Optional[Any]          =	num_hidden_layers
		UpperCamelCase     :Union[str, Any]          =	intermediate_size
		UpperCamelCase     :Optional[int]          =	squeeze_factor
		UpperCamelCase     :List[str]          =	max_position_embeddings
		UpperCamelCase     :List[Any]          =	position_buckets
		UpperCamelCase     :List[str]          =	share_att_key
		UpperCamelCase     :List[Any]          =	relative_attention
		UpperCamelCase     :str          =	norm_rel_ebd
		UpperCamelCase     :List[str]          =	list(snake_case_	)
		UpperCamelCase     :Optional[int]          =	hidden_act
		UpperCamelCase     :List[Any]          =	num_attention_heads
		UpperCamelCase     :Tuple          =	hidden_dropout
		UpperCamelCase     :Tuple          =	attention_dropout
		UpperCamelCase     :Optional[Any]          =	activation_dropout
		UpperCamelCase     :List[Any]          =	feat_proj_dropout
		UpperCamelCase     :Optional[Any]          =	final_dropout
		UpperCamelCase     :Optional[int]          =	layer_norm_eps
		UpperCamelCase     :Dict          =	feature_layer_norm_eps
		UpperCamelCase     :Optional[Any]          =	initializer_range
		UpperCamelCase     :Dict          =	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
		UpperCamelCase     :Dict          =	apply_spec_augment
		UpperCamelCase     :List[Any]          =	mask_time_prob
		UpperCamelCase     :Dict          =	mask_time_length
		UpperCamelCase     :Union[str, Any]          =	mask_time_min_masks
		UpperCamelCase     :List[Any]          =	mask_feature_prob
		UpperCamelCase     :List[str]          =	mask_feature_length
		UpperCamelCase     :Tuple          =	mask_feature_min_masks

		# ctc loss
		UpperCamelCase     :str          =	ctc_loss_reduction
		UpperCamelCase     :Dict          =	ctc_zero_infinity

		# sequence classification
		UpperCamelCase     :List[str]          =	use_weighted_layer_sum
		UpperCamelCase     :List[Any]          =	classifier_proj_size





	@property
	def 						_A (		self				:					List[Any]	):
		return functools.reduce(operator.mul ,  self.conv_stride ,  1	)





'''simple docstring'''





from transformers import BertTokenizerFast

from .custom_tokenization import CustomTokenizer







class     UpperCAmelCase_       (       _a	):
    """simple docstring"""







    lowercase					=		CustomTokenizer
    pass
