

import math

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


lowerCAmelCase							:  Tuple   	=						logging.get_logger(__name__)

lowerCAmelCase							:  Dict   	=						{
    """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   __lowercase				( __lowerCamelCase	):




			"""simple docstring"""







			_UpperCAmelCase   :							Dict										=     'data2vec-audio'



			def __init__( self  :     Any   ,						lowerCAmelCase__  :     List[str]=32   ,						lowerCAmelCase__  :     Optional[Any]=768   ,						lowerCAmelCase__  :     str=12   ,						lowerCAmelCase__  :     int=12   ,						lowerCAmelCase__  :     Optional[Any]=3072   ,						lowerCAmelCase__  :     str="gelu"   ,						lowerCAmelCase__  :     Any=0.1   ,						lowerCAmelCase__  :     Dict=0.1   ,						lowerCAmelCase__  :     List[Any]=0.1   ,						lowerCAmelCase__  :     List[str]=0.0   ,						lowerCAmelCase__  :     str=0.1   ,						lowerCAmelCase__  :     Tuple=0.1   ,						lowerCAmelCase__  :     List[str]=0.02   ,						lowerCAmelCase__  :     int=1E-5   ,						lowerCAmelCase__  :     Union[str, Any]="gelu"   ,						lowerCAmelCase__  :     Union[str, Any]=(512, 512, 512, 512, 512, 512, 512)   ,						lowerCAmelCase__  :     int=(5, 2, 2, 2, 2, 2, 2)   ,						lowerCAmelCase__  :     int=(10, 3, 3, 3, 3, 2, 2)   ,						lowerCAmelCase__  :     Any=False   ,						lowerCAmelCase__  :     Tuple=16   ,						lowerCAmelCase__  :     Union[str, Any]=19   ,						lowerCAmelCase__  :     List[str]=5   ,						lowerCAmelCase__  :     Optional[Any]=0.05   ,						lowerCAmelCase__  :     int=10   ,						lowerCAmelCase__  :     Union[str, Any]=2   ,						lowerCAmelCase__  :     Dict=0.0   ,						lowerCAmelCase__  :     Dict=10   ,						lowerCAmelCase__  :     List[Any]=0   ,						lowerCAmelCase__  :     Tuple="sum"   ,						lowerCAmelCase__  :     Tuple=False   ,						lowerCAmelCase__  :     Optional[int]=False   ,						lowerCAmelCase__  :     int=256   ,						lowerCAmelCase__  :     Dict=(512, 512, 512, 512, 1500)   ,						lowerCAmelCase__  :     List[str]=(5, 3, 3, 1, 1)   ,						lowerCAmelCase__  :     Any=(1, 2, 3, 1, 1)   ,						lowerCAmelCase__  :     Dict=512   ,						lowerCAmelCase__  :     Optional[int]=0   ,						lowerCAmelCase__  :     str=1   ,						lowerCAmelCase__  :     Tuple=2   ,						lowerCAmelCase__  :     str=False   ,						lowerCAmelCase__  :     int=3   ,						lowerCAmelCase__  :     Any=2   ,						lowerCAmelCase__  :     Optional[int]=3   ,						lowerCAmelCase__  :     Tuple=None   ,						**lowerCAmelCase__  :     int   ,						):
									super().__init__(**UpperCamelCase_   ,						pad_token_id=UpperCamelCase_   ,						bos_token_id=UpperCamelCase_   ,						eos_token_id=UpperCamelCase_)
									SCREAMING_SNAKE_CASE_: Tuple  		=       hidden_size
									SCREAMING_SNAKE_CASE_: Union[str, Any]  		=       feat_extract_activation
									SCREAMING_SNAKE_CASE_: Optional[Any]  		=       list(UpperCamelCase_)
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       list(UpperCamelCase_)
									SCREAMING_SNAKE_CASE_: Optional[Any]  		=       list(UpperCamelCase_)
									SCREAMING_SNAKE_CASE_: Tuple  		=       conv_bias
									SCREAMING_SNAKE_CASE_: List[str]  		=       num_conv_pos_embeddings
									SCREAMING_SNAKE_CASE_: List[str]  		=       num_conv_pos_embedding_groups
									SCREAMING_SNAKE_CASE_: Union[str, Any]  		=       conv_pos_kernel_size
									SCREAMING_SNAKE_CASE_: Any  		=       len(self.conv_dim)
									SCREAMING_SNAKE_CASE_: Dict  		=       num_hidden_layers
									SCREAMING_SNAKE_CASE_: List[str]  		=       intermediate_size
									SCREAMING_SNAKE_CASE_: str  		=       hidden_act
									SCREAMING_SNAKE_CASE_: Optional[Any]  		=       num_attention_heads
									SCREAMING_SNAKE_CASE_: List[Any]  		=       hidden_dropout
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       attention_dropout
									SCREAMING_SNAKE_CASE_: Tuple  		=       activation_dropout
									SCREAMING_SNAKE_CASE_: Any  		=       feat_proj_dropout
									SCREAMING_SNAKE_CASE_: List[str]  		=       final_dropout
									SCREAMING_SNAKE_CASE_: Optional[Any]  		=       layerdrop
									SCREAMING_SNAKE_CASE_: Optional[Any]  		=       layer_norm_eps
									SCREAMING_SNAKE_CASE_: str  		=       initializer_range
									SCREAMING_SNAKE_CASE_: Tuple  		=       vocab_size
									SCREAMING_SNAKE_CASE_: Optional[Any]  		=       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
									SCREAMING_SNAKE_CASE_: List[Any]  		=       mask_time_prob
									SCREAMING_SNAKE_CASE_: Dict  		=       mask_time_length
									SCREAMING_SNAKE_CASE_: int  		=       mask_time_min_masks
									SCREAMING_SNAKE_CASE_: Optional[Any]  		=       mask_feature_prob
									SCREAMING_SNAKE_CASE_: Any  		=       mask_feature_length
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       mask_feature_min_masks

									# ctc loss
									SCREAMING_SNAKE_CASE_: int  		=       ctc_loss_reduction
									SCREAMING_SNAKE_CASE_: str  		=       ctc_zero_infinity

									# adapter
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       add_adapter
									SCREAMING_SNAKE_CASE_: int  		=       adapter_kernel_size
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       adapter_stride
									SCREAMING_SNAKE_CASE_: str  		=       num_adapter_layers
									SCREAMING_SNAKE_CASE_: List[str]  		=       output_hidden_size or hidden_size

									# SequenceClassification-specific parameter. Feel free to ignore for other classes.
									SCREAMING_SNAKE_CASE_: List[str]  		=       classifier_proj_size

									# XVector-specific parameters. Feel free to ignore for other classes.
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       list(UpperCamelCase_)
									SCREAMING_SNAKE_CASE_: Optional[Any]  		=       list(UpperCamelCase_)
									SCREAMING_SNAKE_CASE_: Any  		=       list(UpperCamelCase_)
									SCREAMING_SNAKE_CASE_: Any  		=       xvector_output_dim




			@property
			def        _SCREAMING_SNAKE_CASE			( self  :     str):
									return math.prod(self.conv_stride)












from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


UpperCAmelCase_									=	{
    'configuration_vision_encoder_decoder': ['VisionEncoderDecoderConfig', 'VisionEncoderDecoderOnnxConfig']
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       UpperCAmelCase_									=	['VisionEncoderDecoderModel']

try:
       if not is_tf_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       UpperCAmelCase_									=	['TFVisionEncoderDecoderModel']

try:
       if not is_flax_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       UpperCAmelCase_									=	['FlaxVisionEncoderDecoderModel']

if TYPE_CHECKING:
       from .configuration_vision_encoder_decoder import VisionEncoderDecoderConfig, VisionEncoderDecoderOnnxConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_vision_encoder_decoder import VisionEncoderDecoderModel

       try:
              if not is_tf_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_tf_vision_encoder_decoder import TFVisionEncoderDecoderModel

       try:
              if not is_flax_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_flax_vision_encoder_decoder import FlaxVisionEncoderDecoderModel

else:
       import sys

       UpperCAmelCase_									=	_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

