




import math

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


UpperCAmelCase__				     = logging.get_logger(__name__)

UpperCAmelCase__				     = {
    "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 a (     __SCREAMING_SNAKE_CASE  ):
						"""simple docstring"""

						UpperCamelCase_	:       Optional[int]       	=		'data2vec-audio'






						def __init__( self :     str				,							lowerCamelCase__ :     List[str]=32				,							lowerCamelCase__ :     str=768				,							lowerCamelCase__ :     str=12				,							lowerCamelCase__ :     Any=12				,							lowerCamelCase__ :     Any=3_072				,							lowerCamelCase__ :     List[Any]="gelu"				,							lowerCamelCase__ :     Dict=0.1				,							lowerCamelCase__ :     Any=0.1				,							lowerCamelCase__ :     Optional[int]=0.1				,							lowerCamelCase__ :     Any=0.0				,							lowerCamelCase__ :     List[Any]=0.1				,							lowerCamelCase__ :     Optional[int]=0.1				,							lowerCamelCase__ :     List[Any]=0.0_2				,							lowerCamelCase__ :     Any=1e-5				,							lowerCamelCase__ :     Any="gelu"				,							lowerCamelCase__ :     List[str]=(512, 512, 512, 512, 512, 512, 512)				,							lowerCamelCase__ :     List[Any]=(5, 2, 2, 2, 2, 2, 2)				,							lowerCamelCase__ :     Tuple=(10, 3, 3, 3, 3, 2, 2)				,							lowerCamelCase__ :     int=False				,							lowerCamelCase__ :     Optional[Any]=16				,							lowerCamelCase__ :     Union[str, Any]=19				,							lowerCamelCase__ :     str=5				,							lowerCamelCase__ :     Any=0.0_5				,							lowerCamelCase__ :     str=10				,							lowerCamelCase__ :     Optional[Any]=2				,							lowerCamelCase__ :     Any=0.0				,							lowerCamelCase__ :     int=10				,							lowerCamelCase__ :     Optional[Any]=0				,							lowerCamelCase__ :     Optional[Any]="sum"				,							lowerCamelCase__ :     str=False				,							lowerCamelCase__ :     Optional[int]=False				,							lowerCamelCase__ :     Tuple=256				,							lowerCamelCase__ :     Optional[int]=(512, 512, 512, 512, 1_500)				,							lowerCamelCase__ :     Optional[int]=(5, 3, 3, 1, 1)				,							lowerCamelCase__ :     Union[str, Any]=(1, 2, 3, 1, 1)				,							lowerCamelCase__ :     List[Any]=512				,							lowerCamelCase__ :     int=0				,							lowerCamelCase__ :     Optional[Any]=1				,							lowerCamelCase__ :     int=2				,							lowerCamelCase__ :     List[Any]=False				,							lowerCamelCase__ :     Any=3				,							lowerCamelCase__ :     Optional[Any]=2				,							lowerCamelCase__ :     str=3				,							lowerCamelCase__ :     int=None				,							**lowerCamelCase__ :     Union[str, Any]				,							)    ->						Any:
													"""simple docstring"""


													super().__init__(**lowerCamelCase__				,							pad_token_id=lowerCamelCase__				,							bos_token_id=lowerCamelCase__				,							eos_token_id=lowerCamelCase__				)
													__lowercase      =    hidden_size
													__lowercase      =    feat_extract_activation
													__lowercase      =    list(lowerCamelCase__				)
													__lowercase      =    list(lowerCamelCase__				)
													__lowercase      =    list(lowerCamelCase__				)
													__lowercase      =    conv_bias
													__lowercase      =    num_conv_pos_embeddings
													__lowercase      =    num_conv_pos_embedding_groups
													__lowercase      =    conv_pos_kernel_size
													__lowercase      =    len(self.conv_dim				)
													__lowercase      =    num_hidden_layers
													__lowercase      =    intermediate_size
													__lowercase      =    hidden_act
													__lowercase      =    num_attention_heads
													__lowercase      =    hidden_dropout
													__lowercase      =    attention_dropout
													__lowercase      =    activation_dropout
													__lowercase      =    feat_proj_dropout
													__lowercase      =    final_dropout
													__lowercase      =    layerdrop
													__lowercase      =    layer_norm_eps
													__lowercase      =    initializer_range
													__lowercase      =    vocab_size
													__lowercase      =    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
													__lowercase      =    mask_time_prob
													__lowercase      =    mask_time_length
													__lowercase      =    mask_time_min_masks
													__lowercase      =    mask_feature_prob
													__lowercase      =    mask_feature_length
													__lowercase      =    mask_feature_min_masks

													# ctc loss
													__lowercase      =    ctc_loss_reduction
													__lowercase      =    ctc_zero_infinity

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

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

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






						@property
						def     UpperCAmelCase_      ( self :     Union[str, Any]				)    ->						Union[str, Any]:
													"""simple docstring"""


													return math.prod(self.conv_stride				)












import argparse


UpperCAmelCase__				     = "docs/source/_static/js/custom.js"







def 		_A(       UpperCamelCase__							:			Optional[int]				)    -> Optional[int]:
							'''simple docstring'''


							with open(UpperCamelCase__				,       encoding='''utf-8'''				,       newline='''\n'''				) as f:
														__lowercase      =    f.readlines()
							__lowercase      =    0

							# First let's put the right version
							while not lines[index].startswith('''const stableVersion ='''				):
														index += 1
							__lowercase      =    F'const stableVersion = "v{version}"\n'

							# Then update the dictionary
							while not lines[index].startswith('''const versionMapping = {'''				):
														index += 1

							# We go until the end
							while not lines[index].startswith('''}'''				):
														index += 1
							# We add the new version at the end
							lines[index - 1] += F'    "v{version}": "v{version}",\n'

							with open(UpperCamelCase__				,       '''w'''				,       encoding='''utf-8'''				,       newline='''\n'''				) as f:
														f.writelines(UpperCamelCase__				)


if __name__ == "__main__":
			UpperCAmelCase__				     = argparse.ArgumentParser()
			parser.add_argument("--version", help="Release version.")
			UpperCAmelCase__				     = parser.parse_args()
			update_custom_js(args.version)






