





'''simple docstring'''

import math

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


__snake_case:  List[Any]								=			logging.get_logger(__name__)

__snake_case:  List[str]								=			{
    "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  _UpperCAmelCase ( _UpperCAmelCase    ):

     """simple docstring"""

     a_    	=					"data2vec-audio"


     def __init__(      self							,		lowerCAmelCase_=32							,		lowerCAmelCase_=7_68							,		lowerCAmelCase_=12							,		lowerCAmelCase_=12							,		lowerCAmelCase_=30_72							,		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_=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)							,		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_=2_56							,		lowerCAmelCase_=(5_12, 5_12, 5_12, 5_12, 15_00)							,		lowerCAmelCase_=(5, 3, 3, 1, 1)							,		lowerCAmelCase_=(1, 2, 3, 1, 1)							,		lowerCAmelCase_=5_12							,		lowerCAmelCase_=0							,		lowerCAmelCase_=1							,		lowerCAmelCase_=2							,		lowerCAmelCase_=False							,		lowerCAmelCase_=3							,		lowerCAmelCase_=2							,		lowerCAmelCase_=3							,		lowerCAmelCase_=None							,		**lowerCAmelCase_							,		):

       '''simple docstring'''

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

       # ctc loss
       a_      :	Any      =							ctc_loss_reduction
       a_      :	Any      =							ctc_zero_infinity

       # adapter
       a_      :	Any      =							add_adapter
       a_      :	List[Any]      =							adapter_kernel_size
       a_      :	str      =							adapter_stride
       a_      :	List[str]      =							num_adapter_layers
       a_      :	Any      =							output_hidden_size or hidden_size

       # SequenceClassification-specific parameter. Feel free to ignore for other classes.
       a_      :	Dict      =							classifier_proj_size

       # XVector-specific parameters. Feel free to ignore for other classes.
       a_      :	List[Any]      =							list(lowerCamelCase_ )
       a_      :	List[Any]      =							list(lowerCamelCase_ )
       a_      :	Tuple      =							list(lowerCamelCase_ )
       a_      :	Optional[Any]      =							xvector_output_dim






     @property
     def 							_lowerCAmelCase  (      self ):

       '''simple docstring'''

       return math.prod(self.conv_stride )




'''simple docstring'''

from typing import TYPE_CHECKING

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


__snake_case:  Dict								=			{"configuration_encoder_decoder": ["EncoderDecoderConfig"]}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __snake_case:  List[str]								=			["EncoderDecoderModel"]

try:
    if not is_tf_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __snake_case:  Any								=			["TFEncoderDecoderModel"]

try:
    if not is_flax_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __snake_case:  List[str]								=			["FlaxEncoderDecoderModel"]

if TYPE_CHECKING:
    from .configuration_encoder_decoder import EncoderDecoderConfig

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_encoder_decoder import EncoderDecoderModel

    try:
        if not is_tf_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_tf_encoder_decoder import TFEncoderDecoderModel

    try:
        if not is_flax_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_flax_encoder_decoder import FlaxEncoderDecoderModel

else:
    import sys

    __snake_case:  Tuple								=			_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)


