






import functools
import operator

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


a_		:    Tuple   							=     logging.get_logger(__name__)

a_		:    Optional[int]   							=     {
    '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 		_snake_case	(	A__       ):
			_lowercase		:     Union[str, Any]        =				'''wav2vec2'''






			def __init__(							self		,       a=32		,       a=768		,       a=12		,       a=12		,       a=3072		,       a="gelu"		,       a=0.1		,       a=0.1		,       a=0.1		,       a=0.0		,       a=0.0		,       a=0.1		,       a=0.1		,       a=0.02		,       a=1E-5		,       a="group"		,       a="gelu"		,       a=(512, 512, 512, 512, 512, 512, 512)		,       a=(5, 2, 2, 2, 2, 2, 2)		,       a=(10, 3, 3, 3, 3, 2, 2)		,       a=False		,       a=128		,       a=16		,       a=False		,       a=True		,       a=0.05		,       a=10		,       a=2		,       a=0.0		,       a=10		,       a=0		,       a=320		,       a=2		,       a=0.1		,       a=100		,       a=256		,       a=256		,       a=0.1		,       a="sum"		,       a=False		,       a=False		,       a=256		,       a=(512, 512, 512, 512, 1500)		,       a=(5, 3, 3, 1, 1)		,       a=(1, 2, 3, 1, 1)		,       a=512		,       a=0		,       a=1		,       a=2		,       a=False		,       a=3		,       a=2		,       a=3		,       a=None		,       a=None		,       **a		,       )   ->							Tuple:
						super().__init__(**a		,       pad_token_id=a		,       bos_token_id=a		,       eos_token_id=a)
						SCREAMING_SNAKE_CASE							=			hidden_size
						SCREAMING_SNAKE_CASE							=			feat_extract_norm
						SCREAMING_SNAKE_CASE							=			feat_extract_activation
						SCREAMING_SNAKE_CASE							=			list(a)
						SCREAMING_SNAKE_CASE							=			list(a)
						SCREAMING_SNAKE_CASE							=			list(a)
						SCREAMING_SNAKE_CASE							=			conv_bias
						SCREAMING_SNAKE_CASE							=			num_conv_pos_embeddings
						SCREAMING_SNAKE_CASE							=			num_conv_pos_embedding_groups
						SCREAMING_SNAKE_CASE							=			len(self.conv_dim)
						SCREAMING_SNAKE_CASE							=			num_hidden_layers
						SCREAMING_SNAKE_CASE							=			intermediate_size
						SCREAMING_SNAKE_CASE							=			hidden_act
						SCREAMING_SNAKE_CASE							=			num_attention_heads
						SCREAMING_SNAKE_CASE							=			hidden_dropout
						SCREAMING_SNAKE_CASE							=			attention_dropout
						SCREAMING_SNAKE_CASE							=			activation_dropout
						SCREAMING_SNAKE_CASE							=			feat_proj_dropout
						SCREAMING_SNAKE_CASE							=			final_dropout
						SCREAMING_SNAKE_CASE							=			layerdrop
						SCREAMING_SNAKE_CASE							=			layer_norm_eps
						SCREAMING_SNAKE_CASE							=			initializer_range
						SCREAMING_SNAKE_CASE							=			vocab_size
						SCREAMING_SNAKE_CASE							=			do_stable_layer_norm
						SCREAMING_SNAKE_CASE							=			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
						SCREAMING_SNAKE_CASE							=			apply_spec_augment
						SCREAMING_SNAKE_CASE							=			mask_time_prob
						SCREAMING_SNAKE_CASE							=			mask_time_length
						SCREAMING_SNAKE_CASE							=			mask_time_min_masks
						SCREAMING_SNAKE_CASE							=			mask_feature_prob
						SCREAMING_SNAKE_CASE							=			mask_feature_length
						SCREAMING_SNAKE_CASE							=			mask_feature_min_masks

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

						# ctc loss
						SCREAMING_SNAKE_CASE							=			ctc_loss_reduction
						SCREAMING_SNAKE_CASE							=			ctc_zero_infinity

						# adapter
						SCREAMING_SNAKE_CASE							=			add_adapter
						SCREAMING_SNAKE_CASE							=			adapter_kernel_size
						SCREAMING_SNAKE_CASE							=			adapter_stride
						SCREAMING_SNAKE_CASE							=			num_adapter_layers
						SCREAMING_SNAKE_CASE							=			output_hidden_size or hidden_size
						SCREAMING_SNAKE_CASE							=			adapter_attn_dim

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

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







			@property
			def  SCREAMING_SNAKE_CASE__     (							self)   ->							Union[str, Any]:
						return functools.reduce(operator.mul		,       self.conv_stride		,       1)











from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Features, Value
from .base import TaskTemplate




@dataclass(frozen=A__    )
class 			__UpperCamelCase    (							A__    ):
     __A	:  str							  =   field(default="""language-modeling"""	, metadata={"""include_in_asdict_even_if_is_default""": True}    )

     __A	:  ClassVar[Features]							  =   Features({"""text""": Value("""string"""    )}    )
     __A	:  ClassVar[Features]							  =   Features({}    )
     __A	:  str							  =   "text"





     @property
     def 		UpperCamelCase(     self					):
        return {self.text_column: "text"}