


'''simple docstring'''







import math

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


SCREAMING_SNAKE_CASE_   =      logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_   =      {
    """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 			lowerCAmelCase_    (							_A   ):





  """simple docstring"""



  a_							:Dict				       ="""data2vec-audio"""

  def __init__(       self  :				List[Any]					,				SCREAMING_SNAKE_CASE__  :				Any=3_2					,				SCREAMING_SNAKE_CASE__  :				Optional[int]=7_6_8					,				SCREAMING_SNAKE_CASE__  :				Union[str, Any]=1_2					,				SCREAMING_SNAKE_CASE__  :				Dict=1_2					,				SCREAMING_SNAKE_CASE__  :				int=3_0_7_2					,				SCREAMING_SNAKE_CASE__  :				Tuple="gelu"					,				SCREAMING_SNAKE_CASE__  :				List[str]=0.1					,				SCREAMING_SNAKE_CASE__  :				Any=0.1					,				SCREAMING_SNAKE_CASE__  :				List[str]=0.1					,				SCREAMING_SNAKE_CASE__  :				Tuple=0.0					,				SCREAMING_SNAKE_CASE__  :				Any=0.1					,				SCREAMING_SNAKE_CASE__  :				Optional[int]=0.1					,				SCREAMING_SNAKE_CASE__  :				str=0.0_2					,				SCREAMING_SNAKE_CASE__  :				Any=1E-5					,				SCREAMING_SNAKE_CASE__  :				str="gelu"					,				SCREAMING_SNAKE_CASE__  :				Any=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)					,				SCREAMING_SNAKE_CASE__  :				Dict=(5, 2, 2, 2, 2, 2, 2)					,				SCREAMING_SNAKE_CASE__  :				Dict=(1_0, 3, 3, 3, 3, 2, 2)					,				SCREAMING_SNAKE_CASE__  :				List[Any]=False					,				SCREAMING_SNAKE_CASE__  :				Optional[int]=1_6					,				SCREAMING_SNAKE_CASE__  :				Any=1_9					,				SCREAMING_SNAKE_CASE__  :				int=5					,				SCREAMING_SNAKE_CASE__  :				Any=0.0_5					,				SCREAMING_SNAKE_CASE__  :				Optional[Any]=1_0					,				SCREAMING_SNAKE_CASE__  :				Union[str, Any]=2					,				SCREAMING_SNAKE_CASE__  :				int=0.0					,				SCREAMING_SNAKE_CASE__  :				Optional[Any]=1_0					,				SCREAMING_SNAKE_CASE__  :				Optional[Any]=0					,				SCREAMING_SNAKE_CASE__  :				Any="sum"					,				SCREAMING_SNAKE_CASE__  :				Dict=False					,				SCREAMING_SNAKE_CASE__  :				Tuple=False					,				SCREAMING_SNAKE_CASE__  :				List[Any]=2_5_6					,				SCREAMING_SNAKE_CASE__  :				List[str]=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)					,				SCREAMING_SNAKE_CASE__  :				Dict=(5, 3, 3, 1, 1)					,				SCREAMING_SNAKE_CASE__  :				Dict=(1, 2, 3, 1, 1)					,				SCREAMING_SNAKE_CASE__  :				List[Any]=5_1_2					,				SCREAMING_SNAKE_CASE__  :				str=0					,				SCREAMING_SNAKE_CASE__  :				Tuple=1					,				SCREAMING_SNAKE_CASE__  :				Optional[Any]=2					,				SCREAMING_SNAKE_CASE__  :				Optional[Any]=False					,				SCREAMING_SNAKE_CASE__  :				Any=3					,				SCREAMING_SNAKE_CASE__  :				Optional[int]=2					,				SCREAMING_SNAKE_CASE__  :				Any=3					,				SCREAMING_SNAKE_CASE__  :				Tuple=None					,				**SCREAMING_SNAKE_CASE__  :				int					,				):





       '''simple docstring'''

       super().__init__(**snake_case_					,				pad_token_id=snake_case_					,				bos_token_id=snake_case_					,				eos_token_id=snake_case_    )
       __a   			= hidden_size
       __a   			= feat_extract_activation
       __a   			= list(snake_case_    )
       __a   			= list(snake_case_    )
       __a   			= list(snake_case_    )
       __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(snake_case_    )
       __a   			= list(snake_case_    )
       __a   			= list(snake_case_    )
       __a   			= xvector_output_dim


  @property
  def __a    (       self  :				Dict    ):





       '''simple docstring'''

       return math.prod(self.conv_stride    )








from ..utils import is_flax_available, is_torch_available


if is_torch_available():
							from .autoencoder_kl import AutoencoderKL
							from .controlnet import ControlNetModel
							from .dual_transformer_ad import DualTransformeraDModel
							from .modeling_utils import ModelMixin
							from .prior_transformer import PriorTransformer
							from .ta_film_transformer import TaFilmDecoder
							from .transformer_ad import TransformeraDModel
							from .unet_ad import UNetaDModel
							from .unet_ad import UNetaDModel
							from .unet_ad_condition import UNetaDConditionModel
							from .unet_ad_condition import UNetaDConditionModel
							from .vq_model import VQModel

if is_flax_available():
							from .controlnet_flax import FlaxControlNetModel
							from .unet_ad_condition_flax import FlaxUNetaDConditionModel
							from .vae_flax import FlaxAutoencoderKL






