




import functools
import operator

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


_A     =			logging.get_logger(__name__)

_A     =			{
    '''facebook/wav2vec2-base-960h''': '''https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/config.json''',
    # See all Wav2Vec2 models at https://huggingface.co/models?filter=wav2vec2
}


class  A		(  snake_case_     ):
		__snake_case									=   'wav2vec2'



		def __init__(     self,	UpperCamelCase__=32,	UpperCamelCase__=768,	UpperCamelCase__=12,	UpperCamelCase__=12,	UpperCamelCase__=3072,	UpperCamelCase__="gelu",	UpperCamelCase__=0.1,	UpperCamelCase__=0.1,	UpperCamelCase__=0.1,	UpperCamelCase__=0.0,	UpperCamelCase__=0.0,	UpperCamelCase__=0.1,	UpperCamelCase__=0.1,	UpperCamelCase__=0.02,	UpperCamelCase__=1E-5,	UpperCamelCase__="group",	UpperCamelCase__="gelu",	UpperCamelCase__=(512, 512, 512, 512, 512, 512, 512),	UpperCamelCase__=(5, 2, 2, 2, 2, 2, 2),	UpperCamelCase__=(10, 3, 3, 3, 3, 2, 2),	UpperCamelCase__=False,	UpperCamelCase__=128,	UpperCamelCase__=16,	UpperCamelCase__=False,	UpperCamelCase__=True,	UpperCamelCase__=0.05,	UpperCamelCase__=10,	UpperCamelCase__=2,	UpperCamelCase__=0.0,	UpperCamelCase__=10,	UpperCamelCase__=0,	UpperCamelCase__=320,	UpperCamelCase__=2,	UpperCamelCase__=0.1,	UpperCamelCase__=100,	UpperCamelCase__=256,	UpperCamelCase__=256,	UpperCamelCase__=0.1,	UpperCamelCase__="sum",	UpperCamelCase__=False,	UpperCamelCase__=False,	UpperCamelCase__=256,	UpperCamelCase__=(512, 512, 512, 512, 1500),	UpperCamelCase__=(5, 3, 3, 1, 1),	UpperCamelCase__=(1, 2, 3, 1, 1),	UpperCamelCase__=512,	UpperCamelCase__=0,	UpperCamelCase__=1,	UpperCamelCase__=2,	UpperCamelCase__=False,	UpperCamelCase__=3,	UpperCamelCase__=2,	UpperCamelCase__=3,	UpperCamelCase__=None,	UpperCamelCase__=None,	**UpperCamelCase__,	):







								"""simple docstring"""



								super().__init__(**UpperCamelCase__,	pad_token_id=UpperCamelCase__,	bos_token_id=UpperCamelCase__,	eos_token_id=UpperCamelCase__   )
								lowerCAmelCase_      			=  hidden_size
								lowerCAmelCase_      			=  feat_extract_norm
								lowerCAmelCase_      			=  feat_extract_activation
								lowerCAmelCase_      			=  list(UpperCamelCase__   )
								lowerCAmelCase_      			=  list(UpperCamelCase__   )
								lowerCAmelCase_      			=  list(UpperCamelCase__   )
								lowerCAmelCase_      			=  conv_bias
								lowerCAmelCase_      			=  num_conv_pos_embeddings
								lowerCAmelCase_      			=  num_conv_pos_embedding_groups
								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_      			=  do_stable_layer_norm
								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_      			=  apply_spec_augment
								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

								# parameters for pretraining with codevector quantized representations
								lowerCAmelCase_      			=  num_codevectors_per_group
								lowerCAmelCase_      			=  num_codevector_groups
								lowerCAmelCase_      			=  contrastive_logits_temperature
								lowerCAmelCase_      			=  feat_quantizer_dropout
								lowerCAmelCase_      			=  num_negatives
								lowerCAmelCase_      			=  codevector_dim
								lowerCAmelCase_      			=  proj_codevector_dim
								lowerCAmelCase_      			=  diversity_loss_weight

								# 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
								lowerCAmelCase_      			=  adapter_attn_dim

								# 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(UpperCamelCase__   )
								lowerCAmelCase_      			=  list(UpperCamelCase__   )
								lowerCAmelCase_      			=  list(UpperCamelCase__   )
								lowerCAmelCase_      			=  xvector_output_dim







		@property
		def        SCREAMING_SNAKE_CASE__			(     self   ):







								"""simple docstring"""



								return functools.reduce(operator.mul,	self.conv_stride,	1   )












import logging
from dataclasses import dataclass, field
from typing import Optional

from seqaseq_trainer import arg_to_scheduler

from transformers import TrainingArguments


lowercase  							=					logging.getLogger(__name__)




@dataclass
class  UpperCamelCase_      (			snake_case_				):



	'''simple docstring'''




	lowerCAmelCase													= field(
	    default=0.0       ,					metadata={'''help''': '''The label smoothing epsilon to apply (if not zero).'''}				)
	lowerCAmelCase													= field(default=snake_case_       ,					metadata={'''help''': '''Whether to SortishSamler or not.'''}				)
	lowerCAmelCase													= field(
	    default=snake_case_       ,					metadata={'''help''': '''Whether to use generate to calculate generative metrics (ROUGE, BLEU).'''}				)
	lowerCAmelCase													= field(default=snake_case_       ,					metadata={'''help''': '''whether to use adafactor'''}				)
	lowerCAmelCase													= field(
	    default=snake_case_       ,					metadata={'''help''': '''Encoder layer dropout probability. Goes into model.config.'''}				)
	lowerCAmelCase													= field(
	    default=snake_case_       ,					metadata={'''help''': '''Decoder layer dropout probability. Goes into model.config.'''}				)
	lowerCAmelCase													= field(default=snake_case_       ,					metadata={'''help''': '''Dropout probability. Goes into model.config.'''}				)
	lowerCAmelCase													= field(
	    default=snake_case_       ,					metadata={'''help''': '''Attention dropout probability. Goes into model.config.'''}				)
	lowerCAmelCase													= field(
	    default='''linear'''       ,					metadata={'''help''': F'''Which lr scheduler to use. Selected in {sorted(arg_to_scheduler.keys()				)}'''}       ,					)





