


import math

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


A	:		Any    =       logging.get_logger(__name__)

A	:		Optional[Any]    =       {
    'facebook/data2vec-base-960h': 'https://huggingface.co/facebook/data2vec-audio-base-960h/resolve/main/config.json',
    # See all Data2VecAudio models at https://huggingface.co/models?filter=data2vec-audio
}



class 							A   (	UpperCAmelCase__							):
					'''simple docstring'''






					A__      =			'''data2vec-audio'''

					def __init__(self   :						Dict				, _UpperCAmelCase   :						List[Any]=32				, _UpperCAmelCase   :						List[str]=768				, _UpperCAmelCase   :						str=12				, _UpperCAmelCase   :						Union[str, Any]=12				, _UpperCAmelCase   :						str=3072				, _UpperCAmelCase   :						Tuple="gelu"				, _UpperCAmelCase   :						Optional[Any]=0.1				, _UpperCAmelCase   :						Any=0.1				, _UpperCAmelCase   :						Optional[int]=0.1				, _UpperCAmelCase   :						Optional[int]=0.0				, _UpperCAmelCase   :						List[Any]=0.1				, _UpperCAmelCase   :						Optional[Any]=0.1				, _UpperCAmelCase   :						Dict=0.02				, _UpperCAmelCase   :						str=1E-5				, _UpperCAmelCase   :						Dict="gelu"				, _UpperCAmelCase   :						List[str]=(512, 512, 512, 512, 512, 512, 512)				, _UpperCAmelCase   :						Any=(5, 2, 2, 2, 2, 2, 2)				, _UpperCAmelCase   :						List[Any]=(10, 3, 3, 3, 3, 2, 2)				, _UpperCAmelCase   :						Any=False				, _UpperCAmelCase   :						Tuple=16				, _UpperCAmelCase   :						Any=19				, _UpperCAmelCase   :						str=5				, _UpperCAmelCase   :						List[str]=0.05				, _UpperCAmelCase   :						Any=10				, _UpperCAmelCase   :						str=2				, _UpperCAmelCase   :						str=0.0				, _UpperCAmelCase   :						Optional[int]=10				, _UpperCAmelCase   :						List[str]=0				, _UpperCAmelCase   :						Tuple="sum"				, _UpperCAmelCase   :						Union[str, Any]=False				, _UpperCAmelCase   :						Union[str, Any]=False				, _UpperCAmelCase   :						Any=256				, _UpperCAmelCase   :						str=(512, 512, 512, 512, 1500)				, _UpperCAmelCase   :						Dict=(5, 3, 3, 1, 1)				, _UpperCAmelCase   :						Optional[Any]=(1, 2, 3, 1, 1)				, _UpperCAmelCase   :						List[str]=512				, _UpperCAmelCase   :						Any=0				, _UpperCAmelCase   :						Optional[Any]=1				, _UpperCAmelCase   :						Union[str, Any]=2				, _UpperCAmelCase   :						Union[str, Any]=False				, _UpperCAmelCase   :						Optional[int]=3				, _UpperCAmelCase   :						Tuple=2				, _UpperCAmelCase   :						Dict=3				, _UpperCAmelCase   :						Optional[Any]=None				, **_UpperCAmelCase   :						Optional[int]				, )						->       List[str]:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase				, pad_token_id=_UpperCAmelCase				, bos_token_id=_UpperCAmelCase				, eos_token_id=_UpperCAmelCase		)
							lowercase__					      =		hidden_size
							lowercase__					      =		feat_extract_activation
							lowercase__					      =		list(_UpperCAmelCase		)
							lowercase__					      =		list(_UpperCAmelCase		)
							lowercase__					      =		list(_UpperCAmelCase		)
							lowercase__					      =		conv_bias
							lowercase__					      =		num_conv_pos_embeddings
							lowercase__					      =		num_conv_pos_embedding_groups
							lowercase__					      =		conv_pos_kernel_size
							lowercase__					      =		len(self.conv_dim		)
							lowercase__					      =		num_hidden_layers
							lowercase__					      =		intermediate_size
							lowercase__					      =		hidden_act
							lowercase__					      =		num_attention_heads
							lowercase__					      =		hidden_dropout
							lowercase__					      =		attention_dropout
							lowercase__					      =		activation_dropout
							lowercase__					      =		feat_proj_dropout
							lowercase__					      =		final_dropout
							lowercase__					      =		layerdrop
							lowercase__					      =		layer_norm_eps
							lowercase__					      =		initializer_range
							lowercase__					      =		vocab_size
							lowercase__					      =		use_weighted_layer_sum

							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)`, but is `len(config.conv_dim) ="""
									    f''' {len(self.conv_dim		)}`, `len(config.conv_stride) = {len(self.conv_stride		)}`,'''
									    f''' `len(config.conv_kernel) = {len(self.conv_kernel		)}`.'''		)

							# fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
							lowercase__					      =		mask_time_prob
							lowercase__					      =		mask_time_length
							lowercase__					      =		mask_time_min_masks
							lowercase__					      =		mask_feature_prob
							lowercase__					      =		mask_feature_length
							lowercase__					      =		mask_feature_min_masks

							# ctc loss
							lowercase__					      =		ctc_loss_reduction
							lowercase__					      =		ctc_zero_infinity

							# adapter
							lowercase__					      =		add_adapter
							lowercase__					      =		adapter_kernel_size
							lowercase__					      =		adapter_stride
							lowercase__					      =		num_adapter_layers
							lowercase__					      =		output_hidden_size or hidden_size

							# SequenceClassification-specific parameter. Feel free to ignore for other classes.
							lowercase__					      =		classifier_proj_size

							# XVector-specific parameters. Feel free to ignore for other classes.
							lowercase__					      =		list(_UpperCAmelCase		)
							lowercase__					      =		list(_UpperCAmelCase		)
							lowercase__					      =		list(_UpperCAmelCase		)
							lowercase__					      =		xvector_output_dim


					@property
					def   lowerCamelCase__					(self   :						Optional[int]		)						->       Tuple:




							"""simple docstring"""


							return math.prod(self.conv_stride		)





import warnings

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


A	:		List[Any]    =       logging.get_logger(__name__)



class 							A   (	UpperCAmelCase__							):
					'''simple docstring'''






					def __init__(self   :						List[Any]				, *_UpperCAmelCase   :						int				, **_UpperCAmelCase   :						List[str]		)						->       None:




							"""simple docstring"""


							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		)

