"""simple docstring"""


import math

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


a				=logging.get_logger(__name__)

a				={
    '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		(      __lowerCAmelCase      ):
				A__ :  Any    				=			'''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.0_2      ,					_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.0_5      ,					_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 )
										lowerCamelCase__   =hidden_size
										lowerCamelCase__   =feat_extract_activation
										lowerCamelCase__   =list(_lowerCamelCase )
										lowerCamelCase__   =list(_lowerCamelCase )
										lowerCamelCase__   =list(_lowerCamelCase )
										lowerCamelCase__   =conv_bias
										lowerCamelCase__   =num_conv_pos_embeddings
										lowerCamelCase__   =num_conv_pos_embedding_groups
										lowerCamelCase__   =conv_pos_kernel_size
										lowerCamelCase__   =len(self.conv_dim )
										lowerCamelCase__   =num_hidden_layers
										lowerCamelCase__   =intermediate_size
										lowerCamelCase__   =hidden_act
										lowerCamelCase__   =num_attention_heads
										lowerCamelCase__   =hidden_dropout
										lowerCamelCase__   =attention_dropout
										lowerCamelCase__   =activation_dropout
										lowerCamelCase__   =feat_proj_dropout
										lowerCamelCase__   =final_dropout
										lowerCamelCase__   =layerdrop
										lowerCamelCase__   =layer_norm_eps
										lowerCamelCase__   =initializer_range
										lowerCamelCase__   =vocab_size
										lowerCamelCase__   =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
										lowerCamelCase__   =mask_time_prob
										lowerCamelCase__   =mask_time_length
										lowerCamelCase__   =mask_time_min_masks
										lowerCamelCase__   =mask_feature_prob
										lowerCamelCase__   =mask_feature_length
										lowerCamelCase__   =mask_feature_min_masks

										# ctc loss
										lowerCamelCase__   =ctc_loss_reduction
										lowerCamelCase__   =ctc_zero_infinity

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

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

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






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



"""simple docstring"""


import os
from distutils.util import strtobool





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase							)				->   Union[str, Any]:




						'''simple docstring'''



						for e in env_keys:
												lowerCamelCase__   =int(os.environ.get(__lowerCAmelCase  ,       -1							)							)
												if val >= 0:
																		return val
						return default





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase=False							)				->   List[str]:




						'''simple docstring'''



						lowerCamelCase__   =os.environ.get(__lowerCAmelCase  ,       str(__lowerCAmelCase							)							)
						return strtobool(__lowerCAmelCase							) == 1  # As its name indicates `strtobool` actually returns an int...





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase="no"							)				->   Union[str, Any]:




						'''simple docstring'''



						lowerCamelCase__   =os.environ.get(__lowerCAmelCase  ,       str(__lowerCAmelCase							)							)
						return value


