





import math

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


a__: Any							   =						logging.get_logger(__name__)

a__: Tuple							   =						{
    '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        SCREAMING_SNAKE_CASE__					(		UpperCamelCase__ ):
 __SCREAMING_SNAKE_CASE							=      '''data2vec-audio'''



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

        # ctc loss
        A__		   =		ctc_loss_reduction
        A__		   =		ctc_zero_infinity

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

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

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




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












from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a__: List[Any]							   =						{
    'configuration_x_clip': [
        'XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'XCLIPConfig',
        'XCLIPTextConfig',
        'XCLIPVisionConfig',
    ],
    'processing_x_clip': ['XCLIPProcessor'],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a__: Any							   =						[
           'XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST',
           'XCLIPModel',
           'XCLIPPreTrainedModel',
           'XCLIPTextModel',
           'XCLIPVisionModel',
       ]

if TYPE_CHECKING:
       from .configuration_x_clip import (
           XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
           XCLIPConfig,
           XCLIPTextConfig,
           XCLIPVisionConfig,
       )
       from .processing_x_clip import XCLIPProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_x_clip import (
                  XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
                  XCLIPModel,
                  XCLIPPreTrainedModel,
                  XCLIPTextModel,
                  XCLIPVisionModel,
              )

else:
       import sys

       a__: Optional[Any]							   =						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





