


import functools
import operator

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


lowerCAmelCase__       :	Optional[int]     				=logging.get_logger(__name__)

lowerCAmelCase__       :	Any     				={
    'facebook/hubert-base-ls960': 'https://huggingface.co/facebook/hubert-base-ls960/resolve/main/config.json',
    # See all Hubert models at https://huggingface.co/models?filter=hubert
}







class      __lowercase  (__SCREAMING_SNAKE_CASE   ):





							"""simple docstring"""







							_UpperCAmelCase     =		"""hubert"""






							def __init__(	self       ,		lowerCAmelCase__=3_2       ,		lowerCAmelCase__=7_6_8       ,		lowerCAmelCase__=1_2       ,		lowerCAmelCase__=1_2       ,		lowerCAmelCase__=3_0_7_2       ,		lowerCAmelCase__="gelu"       ,		lowerCAmelCase__=0.1       ,		lowerCAmelCase__=0.1       ,		lowerCAmelCase__=0.1       ,		lowerCAmelCase__=True       ,		lowerCAmelCase__=0.0       ,		lowerCAmelCase__=0.1       ,		lowerCAmelCase__=0.1       ,		lowerCAmelCase__=0.02       ,		lowerCAmelCase__=1E-5       ,		lowerCAmelCase__="group"       ,		lowerCAmelCase__="gelu"       ,		lowerCAmelCase__=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)       ,		lowerCAmelCase__=(5, 2, 2, 2, 2, 2, 2)       ,		lowerCAmelCase__=(1_0, 3, 3, 3, 3, 2, 2)       ,		lowerCAmelCase__=False       ,		lowerCAmelCase__=1_2_8       ,		lowerCAmelCase__=1_6       ,		lowerCAmelCase__=False       ,		lowerCAmelCase__=True       ,		lowerCAmelCase__=0.05       ,		lowerCAmelCase__=1_0       ,		lowerCAmelCase__=2       ,		lowerCAmelCase__=0.0       ,		lowerCAmelCase__=1_0       ,		lowerCAmelCase__=0       ,		lowerCAmelCase__="sum"       ,		lowerCAmelCase__=False       ,		lowerCAmelCase__=False       ,		lowerCAmelCase__=2_5_6       ,		lowerCAmelCase__=0       ,		lowerCAmelCase__=1       ,		lowerCAmelCase__=2       ,		**lowerCAmelCase__       ,		):





										"""simple docstring"""




										super().__init__(**lowerCAmelCase__       ,		pad_token_id=lowerCAmelCase__       ,		bos_token_id=lowerCAmelCase__       ,		eos_token_id=lowerCAmelCase__    )
										SCREAMING_SNAKE_CASE_						:			str       						= hidden_size
										SCREAMING_SNAKE_CASE_						:			List[str]       						= feat_extract_norm
										SCREAMING_SNAKE_CASE_						:			str       						= feat_extract_activation
										SCREAMING_SNAKE_CASE_						:			Any       						= list(lowerCAmelCase__    )
										SCREAMING_SNAKE_CASE_						:			List[str]       						= list(lowerCAmelCase__    )
										SCREAMING_SNAKE_CASE_						:			Optional[Any]       						= list(lowerCAmelCase__    )
										SCREAMING_SNAKE_CASE_						:			str       						= conv_bias
										SCREAMING_SNAKE_CASE_						:			str       						= num_conv_pos_embeddings
										SCREAMING_SNAKE_CASE_						:			Dict       						= num_conv_pos_embedding_groups
										SCREAMING_SNAKE_CASE_						:			List[Any]       						= len(self.conv_dim    )
										SCREAMING_SNAKE_CASE_						:			Any       						= num_hidden_layers
										SCREAMING_SNAKE_CASE_						:			List[Any]       						= intermediate_size
										SCREAMING_SNAKE_CASE_						:			Union[str, Any]       						= hidden_act
										SCREAMING_SNAKE_CASE_						:			Any       						= num_attention_heads
										SCREAMING_SNAKE_CASE_						:			Any       						= hidden_dropout
										SCREAMING_SNAKE_CASE_						:			List[str]       						= attention_dropout
										SCREAMING_SNAKE_CASE_						:			Tuple       						= activation_dropout
										SCREAMING_SNAKE_CASE_						:			Union[str, Any]       						= feat_proj_layer_norm
										SCREAMING_SNAKE_CASE_						:			List[Any]       						= feat_proj_dropout
										SCREAMING_SNAKE_CASE_						:			int       						= final_dropout
										SCREAMING_SNAKE_CASE_						:			int       						= layerdrop
										SCREAMING_SNAKE_CASE_						:			List[Any]       						= layer_norm_eps
										SCREAMING_SNAKE_CASE_						:			Tuple       						= initializer_range
										SCREAMING_SNAKE_CASE_						:			Union[str, Any]       						= vocab_size
										SCREAMING_SNAKE_CASE_						:			List[str]       						= do_stable_layer_norm
										SCREAMING_SNAKE_CASE_						:			Any       						= use_weighted_layer_sum
										SCREAMING_SNAKE_CASE_						:			str       						= classifier_proj_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)`, 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
										SCREAMING_SNAKE_CASE_						:			int       						= apply_spec_augment
										SCREAMING_SNAKE_CASE_						:			Optional[int]       						= mask_time_prob
										SCREAMING_SNAKE_CASE_						:			str       						= mask_time_length
										SCREAMING_SNAKE_CASE_						:			Tuple       						= mask_time_min_masks
										SCREAMING_SNAKE_CASE_						:			Union[str, Any]       						= mask_feature_prob
										SCREAMING_SNAKE_CASE_						:			List[str]       						= mask_feature_length
										SCREAMING_SNAKE_CASE_						:			Tuple       						= mask_feature_min_masks

										# ctc loss
										SCREAMING_SNAKE_CASE_						:			List[str]       						= ctc_loss_reduction
										SCREAMING_SNAKE_CASE_						:			List[str]       						= ctc_zero_infinity






							@property
							def  UpperCamelCase__			(	self    ):





										"""simple docstring"""




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









import warnings

from ...utils import logging
from .image_processing_vilt import ViltImageProcessor


lowerCAmelCase__       :	int     				=logging.get_logger(__name__)







class      __lowercase  (__SCREAMING_SNAKE_CASE   ):





							"""simple docstring"""







							def __init__(	self       ,		*lowerCAmelCase__       ,		**lowerCAmelCase__    ):





										"""simple docstring"""




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





