






"""simple docstring"""




import functools
import operator

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


_snake_case          =   logging.get_logger(__name__)

_snake_case          =   {
    '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			(	snake_case_      ):
 UpperCamelCase					:       Dict			=					'''sew-d'''


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

   # ctc loss
   _a  :       Union[str, Any]             =	ctc_loss_reduction
   _a  :       int             =	ctc_zero_infinity

   # sequence classification
   _a  :       int             =	use_weighted_layer_sum
   _a  :       str             =	classifier_proj_size







 @property
 def _lowercase	(     self		:						List[str]							)					->       int:
   return functools.reduce(operator.mul							,						self.conv_stride							,						1							)









"""simple docstring"""




import warnings

from ...utils import logging
from .image_processing_clip import CLIPImageProcessor


_snake_case          =   logging.get_logger(__name__)






class        UpperCamelCase			(	snake_case_      ):


 def __init__(     self		:						Any							,						*UpperCAmelCase__		:						Optional[Any]							,						**UpperCAmelCase__		:						Tuple							)					->       None:
   warnings.warn(
       """The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please"""
       """ use CLIPImageProcessor instead."""							,						UpperCAmelCase__							,						)
   super().__init__(*UpperCAmelCase__							,						**UpperCAmelCase__							)

