





'''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    lowerCamelCase  (      __A       ):
	snake_case_      =   "sew-d"



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

			# ctc loss
			lowerCAmelCase     :    List[str]						=   ctc_loss_reduction
			lowerCAmelCase     :    Dict						=   ctc_zero_infinity

			# sequence classification
			lowerCAmelCase     :    int						=   use_weighted_layer_sum
			lowerCAmelCase     :    Dict						=   classifier_proj_size





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










'''simple docstring'''






import warnings

from ...utils import logging
from .image_processing_chinese_clip import ChineseCLIPImageProcessor


lowerCAmelCase       		=      logging.get_logger(__name__)
class 		lowerCamelCase  (      _A       ):



	def __init__(   self		,      *a_		,      **a_	):
			warnings.warn(
			    "The class ChineseCLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers."
			    " Please use ChineseCLIPImageProcessor instead."		,      a_		,      )
			super().__init__(*a_		,      **a_	)



