





"""simple docstring"""
import functools
import operator

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


_snake_case     :		Dict       						= logging.get_logger(__name__)

_snake_case     :		Optional[int]       						= {
    '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   (	lowercase_ ):
					UpperCamelCase      =							'''sew-d'''


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

												# ctc loss
												A		=  ctc_loss_reduction
												A		=  ctc_zero_infinity

												# sequence classification
												A		=  use_weighted_layer_sum
												A		=  classifier_proj_size


					@property
					def 	lowerCamelCase       (					self			:str		):
												return functools.reduce(operator.mul     ,       self.conv_stride     ,       1		)









"""simple docstring"""
_snake_case     :		Optional[int]       						= [
    'DownloadConfig',
    'DownloadManager',
    'DownloadMode',
    'StreamingDownloadManager',
]

from .download_config import DownloadConfig
from .download_manager import DownloadManager, DownloadMode
from .streaming_download_manager import StreamingDownloadManager


