"""simple docstring"""






import math

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


lowerCAmelCase__  :  Union[str, Any]						     =	logging.get_logger(__name__)

lowerCAmelCase__  :  Optional[int]						     =	{
    '''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 				snake_case       ( snake_case__				):




					"""simple docstring"""

					snake_case__				    = '''data2vec-audio'''







					def __init__(				self   :	int    ,lowerCamelCase__   :	Dict=32    ,lowerCamelCase__   :	Dict=768    ,lowerCamelCase__   :	Any=12    ,lowerCamelCase__   :	List[Any]=12    ,lowerCamelCase__   :	int=3_072    ,lowerCamelCase__   :	Optional[int]="gelu"    ,lowerCamelCase__   :	Dict=0.1    ,lowerCamelCase__   :	Tuple=0.1    ,lowerCamelCase__   :	int=0.1    ,lowerCamelCase__   :	Tuple=0.0    ,lowerCamelCase__   :	int=0.1    ,lowerCamelCase__   :	List[Any]=0.1    ,lowerCamelCase__   :	Tuple=0.0_2    ,lowerCamelCase__   :	Union[str, Any]=1e-5    ,lowerCamelCase__   :	Union[str, Any]="gelu"    ,lowerCamelCase__   :	Tuple=(512, 512, 512, 512, 512, 512, 512)    ,lowerCamelCase__   :	Optional[Any]=(5, 2, 2, 2, 2, 2, 2)    ,lowerCamelCase__   :	int=(10, 3, 3, 3, 3, 2, 2)    ,lowerCamelCase__   :	Dict=False    ,lowerCamelCase__   :	str=16    ,lowerCamelCase__   :	Tuple=19    ,lowerCamelCase__   :	str=5    ,lowerCamelCase__   :	Dict=0.0_5    ,lowerCamelCase__   :	Tuple=10    ,lowerCamelCase__   :	Optional[Any]=2    ,lowerCamelCase__   :	str=0.0    ,lowerCamelCase__   :	str=10    ,lowerCamelCase__   :	Optional[int]=0    ,lowerCamelCase__   :	Tuple="sum"    ,lowerCamelCase__   :	Tuple=False    ,lowerCamelCase__   :	Dict=False    ,lowerCamelCase__   :	Any=256    ,lowerCamelCase__   :	Optional[int]=(512, 512, 512, 512, 1_500)    ,lowerCamelCase__   :	str=(5, 3, 3, 1, 1)    ,lowerCamelCase__   :	Tuple=(1, 2, 3, 1, 1)    ,lowerCamelCase__   :	Dict=512    ,lowerCamelCase__   :	Dict=0    ,lowerCamelCase__   :	Optional[Any]=1    ,lowerCamelCase__   :	Union[str, Any]=2    ,lowerCamelCase__   :	int=False    ,lowerCamelCase__   :	int=3    ,lowerCamelCase__   :	Dict=2    ,lowerCamelCase__   :	Optional[Any]=3    ,lowerCamelCase__   :	Tuple=None    ,**lowerCamelCase__   :	List[str]    ,):
									super().__init__(**_A    ,pad_token_id=_A    ,bos_token_id=_A    ,eos_token_id=_A			)
									UpperCAmelCase__             =							hidden_size
									UpperCAmelCase__             =							feat_extract_activation
									UpperCAmelCase__             =							list(_A			)
									UpperCAmelCase__             =							list(_A			)
									UpperCAmelCase__             =							list(_A			)
									UpperCAmelCase__             =							conv_bias
									UpperCAmelCase__             =							num_conv_pos_embeddings
									UpperCAmelCase__             =							num_conv_pos_embedding_groups
									UpperCAmelCase__             =							conv_pos_kernel_size
									UpperCAmelCase__             =							len(self.conv_dim			)
									UpperCAmelCase__             =							num_hidden_layers
									UpperCAmelCase__             =							intermediate_size
									UpperCAmelCase__             =							hidden_act
									UpperCAmelCase__             =							num_attention_heads
									UpperCAmelCase__             =							hidden_dropout
									UpperCAmelCase__             =							attention_dropout
									UpperCAmelCase__             =							activation_dropout
									UpperCAmelCase__             =							feat_proj_dropout
									UpperCAmelCase__             =							final_dropout
									UpperCAmelCase__             =							layerdrop
									UpperCAmelCase__             =							layer_norm_eps
									UpperCAmelCase__             =							initializer_range
									UpperCAmelCase__             =							vocab_size
									UpperCAmelCase__             =							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
									UpperCAmelCase__             =							mask_time_prob
									UpperCAmelCase__             =							mask_time_length
									UpperCAmelCase__             =							mask_time_min_masks
									UpperCAmelCase__             =							mask_feature_prob
									UpperCAmelCase__             =							mask_feature_length
									UpperCAmelCase__             =							mask_feature_min_masks

									# ctc loss
									UpperCAmelCase__             =							ctc_loss_reduction
									UpperCAmelCase__             =							ctc_zero_infinity

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

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

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







					@property
					def 		__lowerCAmelCase						(				self   :	Optional[Any]			):
									return math.prod(self.conv_stride			)










from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


UpperCAmelCase						:   Optional[int]			  =     {
    '''configuration_xlm''': ['''XLM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''XLMConfig''', '''XLMOnnxConfig'''],
    '''tokenization_xlm''': ['''XLMTokenizer'''],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase						:   Union[str, Any]			  =     [
				    '''XLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''XLMForMultipleChoice''',
				    '''XLMForQuestionAnswering''',
				    '''XLMForQuestionAnsweringSimple''',
				    '''XLMForSequenceClassification''',
				    '''XLMForTokenClassification''',
				    '''XLMModel''',
				    '''XLMPreTrainedModel''',
				    '''XLMWithLMHeadModel''',
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase						:   Optional[Any]			  =     [
				    '''TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''TFXLMForMultipleChoice''',
				    '''TFXLMForQuestionAnsweringSimple''',
				    '''TFXLMForSequenceClassification''',
				    '''TFXLMForTokenClassification''',
				    '''TFXLMMainLayer''',
				    '''TFXLMModel''',
				    '''TFXLMPreTrainedModel''',
				    '''TFXLMWithLMHeadModel''',
				]


if TYPE_CHECKING:
				from .configuration_xlm import XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMConfig, XLMOnnxConfig
				from .tokenization_xlm import XLMTokenizer

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_xlm import (
								    XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
								    XLMForMultipleChoice,
								    XLMForQuestionAnswering,
								    XLMForQuestionAnsweringSimple,
								    XLMForSequenceClassification,
								    XLMForTokenClassification,
								    XLMModel,
								    XLMPreTrainedModel,
								    XLMWithLMHeadModel,
								)

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_xlm import (
								    TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFXLMForMultipleChoice,
								    TFXLMForQuestionAnsweringSimple,
								    TFXLMForSequenceClassification,
								    TFXLMForTokenClassification,
								    TFXLMMainLayer,
								    TFXLMModel,
								    TFXLMPreTrainedModel,
								    TFXLMWithLMHeadModel,
								)

else:
				import sys

				UpperCAmelCase						:   str			  =     _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)




