





"""simple docstring"""





import functools
import operator

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


_UpperCamelCase							=      logging.get_logger(__name__)

_UpperCamelCase							=      {
    'microsoft/unispeech-large-1500h-cv': (
        'https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json'
    ),
    # See all UniSpeech models at https://huggingface.co/models?filter=unispeech
}
class 		SCREAMING_SNAKE_CASE_							(    UpperCAmelCase__   ):
				"""simple docstring"""
				__snake_case   :       List[str]	 =		"unispeech"




				def __init__(     self  :List[str]						,    __lowercase  :Dict=32						,    __lowercase  :List[str]=768						,    __lowercase  :str=12						,    __lowercase  :int=12						,    __lowercase  :int=3072						,    __lowercase  :Any="gelu"						,    __lowercase  :List[Any]=0.1						,    __lowercase  :List[Any]=0.1						,    __lowercase  :Optional[int]=0.1						,    __lowercase  :str=0.0						,    __lowercase  :int=0.0						,    __lowercase  :Dict=0.1						,    __lowercase  :int=0.1						,    __lowercase  :List[str]=0.02						,    __lowercase  :Tuple=1e-5						,    __lowercase  :Optional[int]="group"						,    __lowercase  :List[str]="gelu"						,    __lowercase  :Optional[Any]=(512, 512, 512, 512, 512, 512, 512)						,    __lowercase  :Optional[int]=(5, 2, 2, 2, 2, 2, 2)						,    __lowercase  :List[Any]=(10, 3, 3, 3, 3, 2, 2)						,    __lowercase  :int=False						,    __lowercase  :Union[str, Any]=128						,    __lowercase  :List[Any]=16						,    __lowercase  :List[str]=False						,    __lowercase  :List[Any]=True						,    __lowercase  :List[Any]=0.05						,    __lowercase  :Dict=10						,    __lowercase  :Union[str, Any]=2						,    __lowercase  :List[Any]=0.0						,    __lowercase  :Tuple=10						,    __lowercase  :Optional[Any]=0						,    __lowercase  :str=320						,    __lowercase  :Dict=2						,    __lowercase  :int=0.1						,    __lowercase  :Optional[int]=100						,    __lowercase  :Optional[Any]=256						,    __lowercase  :Any=256						,    __lowercase  :Any=0.1						,    __lowercase  :str="mean"						,    __lowercase  :Optional[Any]=False						,    __lowercase  :Tuple=False						,    __lowercase  :str=256						,    __lowercase  :List[str]=80						,    __lowercase  :Tuple=0						,    __lowercase  :Optional[Any]=1						,    __lowercase  :Optional[Any]=2						,    __lowercase  :str=0.5						,    **__lowercase  :Union[str, Any]						,    ):
											super().__init__(**lowerCamelCase__						,    pad_token_id=lowerCamelCase__						,    bos_token_id=lowerCamelCase__						,    eos_token_id=lowerCamelCase__			)
											__lowerCamelCase      :      Any         =hidden_size
											__lowerCamelCase      :      Any         =feat_extract_norm
											__lowerCamelCase      :      Optional[int]         =feat_extract_activation
											__lowerCamelCase      :      Tuple         =list(lowerCamelCase__			)
											__lowerCamelCase      :      Union[str, Any]         =list(lowerCamelCase__			)
											__lowerCamelCase      :      Tuple         =list(lowerCamelCase__			)
											__lowerCamelCase      :      List[str]         =conv_bias
											__lowerCamelCase      :      int         =num_conv_pos_embeddings
											__lowerCamelCase      :      Dict         =num_conv_pos_embedding_groups
											__lowerCamelCase      :      Union[str, Any]         =len(self.conv_dim			)
											__lowerCamelCase      :      Optional[int]         =num_hidden_layers
											__lowerCamelCase      :      Tuple         =intermediate_size
											__lowerCamelCase      :      List[Any]         =hidden_act
											__lowerCamelCase      :      Optional[int]         =num_attention_heads
											__lowerCamelCase      :      Dict         =hidden_dropout
											__lowerCamelCase      :      List[str]         =attention_dropout
											__lowerCamelCase      :      int         =activation_dropout
											__lowerCamelCase      :      Union[str, Any]         =feat_proj_dropout
											__lowerCamelCase      :      List[Any]         =final_dropout
											__lowerCamelCase      :      List[str]         =layerdrop
											__lowerCamelCase      :      Union[str, Any]         =layer_norm_eps
											__lowerCamelCase      :      Tuple         =initializer_range
											__lowerCamelCase      :      int         =num_ctc_classes
											__lowerCamelCase      :      Tuple         =vocab_size
											__lowerCamelCase      :      List[str]         =do_stable_layer_norm
											__lowerCamelCase      :      Optional[Any]         =use_weighted_layer_sum
											__lowerCamelCase      :      Dict         =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
											__lowerCamelCase      :      List[str]         =apply_spec_augment
											__lowerCamelCase      :      int         =mask_time_prob
											__lowerCamelCase      :      Union[str, Any]         =mask_time_length
											__lowerCamelCase      :      str         =mask_time_min_masks
											__lowerCamelCase      :      Dict         =mask_feature_prob
											__lowerCamelCase      :      Any         =mask_feature_length
											__lowerCamelCase      :      Union[str, Any]         =mask_feature_min_masks

											# parameters for pretraining with codevector quantized representations
											__lowerCamelCase      :      List[str]         =num_codevectors_per_group
											__lowerCamelCase      :      str         =num_codevector_groups
											__lowerCamelCase      :      Optional[Any]         =contrastive_logits_temperature
											__lowerCamelCase      :      Union[str, Any]         =feat_quantizer_dropout
											__lowerCamelCase      :      Any         =num_negatives
											__lowerCamelCase      :      str         =codevector_dim
											__lowerCamelCase      :      List[str]         =proj_codevector_dim
											__lowerCamelCase      :      Dict         =diversity_loss_weight

											# ctc loss
											__lowerCamelCase      :      Optional[int]         =ctc_loss_reduction
											__lowerCamelCase      :      Tuple         =ctc_zero_infinity

											# pretraining loss
											__lowerCamelCase      :      List[str]         =replace_prob




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











"""simple docstring"""





import warnings

from ...utils import logging
from .image_processing_flava import FlavaImageProcessor


_UpperCamelCase							=      logging.get_logger(__name__)
class 		SCREAMING_SNAKE_CASE_							(    snake_case__   ):
				"""simple docstring"""




				def __init__(     self  :List[str]						,    *__lowercase  :int						,    **__lowercase  :Any			):
											warnings.warn(
											    '''The class FlavaFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please'''
											    ''' use FlavaImageProcessor instead.'''						,    __lowercase						,    )
											super().__init__(*__lowercase						,    **__lowercase			)




