
'''simple docstring'''







import functools
import operator

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


__lowerCAmelCase         =    logging.get_logger(__name__)

__lowerCAmelCase         =    {
    """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__	):





  """simple docstring"""

  __UpperCAmelCase				:				str   =					'''sew-d'''


  def __init__(		self      :     Any							,_a      :     Dict=32							,_a      :     Optional[Any]=768							,_a      :     Dict=12							,_a      :     Union[str, Any]=12							,_a      :     int=3072							,_a      :     Optional[int]=2							,_a      :     Optional[Any]=512							,_a      :     Optional[int]=256							,_a      :     Dict=True							,_a      :     List[Any]=True							,_a      :     Any=("p2c", "c2p")							,_a      :     Optional[Any]="layer_norm"							,_a      :     Dict="gelu_python"							,_a      :     Tuple=0.1							,_a      :     Union[str, Any]=0.1							,_a      :     Union[str, Any]=0.1							,_a      :     Dict=0.0							,_a      :     int=0.1							,_a      :     Any=0.02							,_a      :     int=1E-7							,_a      :     Any=1E-5							,_a      :     int="group"							,_a      :     int="gelu"							,_a      :     List[str]=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)							,_a      :     List[str]=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)							,_a      :     Optional[int]=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)							,_a      :     List[Any]=False							,_a      :     str=128							,_a      :     List[str]=16							,_a      :     List[Any]=True							,_a      :     Tuple=0.05							,_a      :     Tuple=10							,_a      :     List[str]=2							,_a      :     Optional[int]=0.0							,_a      :     List[Any]=10							,_a      :     Union[str, Any]=0							,_a      :     Optional[Any]="mean"							,_a      :     Any=False							,_a      :     Union[str, Any]=False							,_a      :     Union[str, Any]=256							,_a      :     Optional[Any]=0							,_a      :     str=1							,_a      :     Optional[int]=2							,**_a      :     Dict							,):


     '''simple docstring'''






     super().__init__(**_a							,pad_token_id=_a							,bos_token_id=_a							,eos_token_id=_a       )
     _a				:	Optional[Any]			=   hidden_size
     _a				:	str			=   feat_extract_norm
     _a				:	Dict			=   feat_extract_activation
     _a				:	Tuple			=   list(_a       )
     _a				:	int			=   list(_a       )
     _a				:	Tuple			=   list(_a       )
     _a				:	List[str]			=   conv_bias
     _a				:	Union[str, Any]			=   num_conv_pos_embeddings
     _a				:	Dict			=   num_conv_pos_embedding_groups
     _a				:	Dict			=   len(self.conv_dim       )
     _a				:	List[str]			=   num_hidden_layers
     _a				:	Union[str, Any]			=   intermediate_size
     _a				:	Tuple			=   squeeze_factor
     _a				:	Dict			=   max_position_embeddings
     _a				:	Any			=   position_buckets
     _a				:	Optional[int]			=   share_att_key
     _a				:	str			=   relative_attention
     _a				:	Dict			=   norm_rel_ebd
     _a				:	int			=   list(_a       )
     _a				:	Dict			=   hidden_act
     _a				:	Union[str, Any]			=   num_attention_heads
     _a				:	str			=   hidden_dropout
     _a				:	List[str]			=   attention_dropout
     _a				:	int			=   activation_dropout
     _a				:	Dict			=   feat_proj_dropout
     _a				:	Optional[int]			=   final_dropout
     _a				:	str			=   layer_norm_eps
     _a				:	List[Any]			=   feature_layer_norm_eps
     _a				:	int			=   initializer_range
     _a				:	Union[str, Any]			=   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				:	List[str]			=   apply_spec_augment
     _a				:	Optional[int]			=   mask_time_prob
     _a				:	str			=   mask_time_length
     _a				:	Dict			=   mask_time_min_masks
     _a				:	int			=   mask_feature_prob
     _a				:	Tuple			=   mask_feature_length
     _a				:	Optional[Any]			=   mask_feature_min_masks

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

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


  @property
  def   __lowercase		(		self      :     Any       ):


     '''simple docstring'''






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





'''simple docstring'''







import warnings

from ...utils import logging
from .image_processing_beit import BeitImageProcessor


__lowerCAmelCase         =    logging.get_logger(__name__)







class UpperCAmelCase__	( lowercase__	):





  """simple docstring"""

  def __init__(		self      :     int							,*_a      :     Optional[int]							,**_a      :     str       ):


     '''simple docstring'''






     warnings.warn(
         'The class BeitFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please'
         ' use BeitImageProcessor instead.'							,_a							,)
     super().__init__(*_a							,**_a       )



