
"""simple docstring"""






import math

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


lowerCamelCase__ :       List[Any]						     =			logging.get_logger(__name__)

lowerCamelCase__ :       List[str]						     =			{
    "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 				lowercase__(				_UpperCAmelCase   ):
	'''simple docstring'''

	UpperCamelCase				=  """data2vec-audio"""





	def __init__(						self    :Optional[Any]		, lowerCamelCase_    :Optional[int]=32		, lowerCamelCase_    :Tuple=7_68		, lowerCamelCase_    :Dict=12		, lowerCamelCase_    :Optional[Any]=12		, lowerCamelCase_    :Optional[Any]=30_72		, lowerCamelCase_    :Any="gelu"		, lowerCamelCase_    :int=0.1		, lowerCamelCase_    :List[Any]=0.1		, lowerCamelCase_    :Optional[Any]=0.1		, lowerCamelCase_    :Union[str, Any]=0.0		, lowerCamelCase_    :Optional[int]=0.1		, lowerCamelCase_    :Tuple=0.1		, lowerCamelCase_    :Optional[Any]=0.0_2		, lowerCamelCase_    :int=1E-5		, lowerCamelCase_    :int="gelu"		, lowerCamelCase_    :str=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)		, lowerCamelCase_    :List[str]=(5, 2, 2, 2, 2, 2, 2)		, lowerCamelCase_    :str=(10, 3, 3, 3, 3, 2, 2)		, lowerCamelCase_    :int=False		, lowerCamelCase_    :Union[str, Any]=16		, lowerCamelCase_    :Optional[Any]=19		, lowerCamelCase_    :Dict=5		, lowerCamelCase_    :Any=0.0_5		, lowerCamelCase_    :str=10		, lowerCamelCase_    :Optional[Any]=2		, lowerCamelCase_    :Union[str, Any]=0.0		, lowerCamelCase_    :int=10		, lowerCamelCase_    :int=0		, lowerCamelCase_    :List[Any]="sum"		, lowerCamelCase_    :int=False		, lowerCamelCase_    :Tuple=False		, lowerCamelCase_    :Tuple=2_56		, lowerCamelCase_    :Union[str, Any]=(5_12, 5_12, 5_12, 5_12, 15_00)		, lowerCamelCase_    :Optional[Any]=(5, 3, 3, 1, 1)		, lowerCamelCase_    :Tuple=(1, 2, 3, 1, 1)		, lowerCamelCase_    :Union[str, Any]=5_12		, lowerCamelCase_    :Any=0		, lowerCamelCase_    :Any=1		, lowerCamelCase_    :List[Any]=2		, lowerCamelCase_    :Union[str, Any]=False		, lowerCamelCase_    :Dict=3		, lowerCamelCase_    :List[str]=2		, lowerCamelCase_    :Optional[int]=3		, lowerCamelCase_    :Dict=None		, **lowerCamelCase_    :Optional[int]		, )							->			List[str]:







			'''simple docstring'''




			super().__init__(**lowerCamelCase_		, pad_token_id=lowerCamelCase_		, bos_token_id=lowerCamelCase_		, eos_token_id=lowerCamelCase_					)
			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= hidden_size
			SCREAMING_SNAKE_CASE       :     List[Any]				= feat_extract_activation
			SCREAMING_SNAKE_CASE       :     int				= list(lowerCamelCase_					)
			SCREAMING_SNAKE_CASE       :     Tuple				= list(lowerCamelCase_					)
			SCREAMING_SNAKE_CASE       :     Any				= list(lowerCamelCase_					)
			SCREAMING_SNAKE_CASE       :     str				= conv_bias
			SCREAMING_SNAKE_CASE       :     str				= num_conv_pos_embeddings
			SCREAMING_SNAKE_CASE       :     List[str]				= num_conv_pos_embedding_groups
			SCREAMING_SNAKE_CASE       :     Optional[int]				= conv_pos_kernel_size
			SCREAMING_SNAKE_CASE       :     Optional[int]				= len(self.conv_dim					)
			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= num_hidden_layers
			SCREAMING_SNAKE_CASE       :     int				= intermediate_size
			SCREAMING_SNAKE_CASE       :     List[str]				= hidden_act
			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= num_attention_heads
			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= hidden_dropout
			SCREAMING_SNAKE_CASE       :     List[str]				= attention_dropout
			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= activation_dropout
			SCREAMING_SNAKE_CASE       :     str				= feat_proj_dropout
			SCREAMING_SNAKE_CASE       :     int				= final_dropout
			SCREAMING_SNAKE_CASE       :     Dict				= layerdrop
			SCREAMING_SNAKE_CASE       :     Any				= layer_norm_eps
			SCREAMING_SNAKE_CASE       :     Tuple				= initializer_range
			SCREAMING_SNAKE_CASE       :     str				= vocab_size
			SCREAMING_SNAKE_CASE       :     List[str]				= 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       :     Optional[int]				= mask_time_prob
			SCREAMING_SNAKE_CASE       :     str				= mask_time_length
			SCREAMING_SNAKE_CASE       :     Tuple				= mask_time_min_masks
			SCREAMING_SNAKE_CASE       :     str				= mask_feature_prob
			SCREAMING_SNAKE_CASE       :     List[str]				= mask_feature_length
			SCREAMING_SNAKE_CASE       :     Any				= mask_feature_min_masks

			# ctc loss
			SCREAMING_SNAKE_CASE       :     Any				= ctc_loss_reduction
			SCREAMING_SNAKE_CASE       :     Any				= ctc_zero_infinity

			# adapter
			SCREAMING_SNAKE_CASE       :     Any				= add_adapter
			SCREAMING_SNAKE_CASE       :     List[Any]				= adapter_kernel_size
			SCREAMING_SNAKE_CASE       :     str				= adapter_stride
			SCREAMING_SNAKE_CASE       :     List[str]				= num_adapter_layers
			SCREAMING_SNAKE_CASE       :     Any				= output_hidden_size or hidden_size

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

			# XVector-specific parameters. Feel free to ignore for other classes.
			SCREAMING_SNAKE_CASE       :     List[Any]				= list(lowerCamelCase_					)
			SCREAMING_SNAKE_CASE       :     List[Any]				= list(lowerCamelCase_					)
			SCREAMING_SNAKE_CASE       :     Tuple				= list(lowerCamelCase_					)
			SCREAMING_SNAKE_CASE       :     Optional[Any]				= xvector_output_dim







	@property
	def   __lowerCAmelCase (						self    :List[str]					)							->			int:







			'''simple docstring'''




			return math.prod(self.conv_stride					)







"""simple docstring"""






from typing import TYPE_CHECKING

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


lowerCamelCase__ :       Tuple						     =			{
    "configuration_mctct": ["MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MCTCTConfig"],
    "feature_extraction_mctct": ["MCTCTFeatureExtractor"],
    "processing_mctct": ["MCTCTProcessor"],
}


try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase__ :       Union[str, Any]						     =			[
					    "MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "MCTCTForCTC",
					    "MCTCTModel",
					    "MCTCTPreTrainedModel",
					]


if TYPE_CHECKING:
					from .configuration_mctct import MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP, MCTCTConfig
					from .feature_extraction_mctct import MCTCTFeatureExtractor
					from .processing_mctct import MCTCTProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_mctct import MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST, MCTCTForCTC, MCTCTModel, MCTCTPreTrainedModel

else:
					import sys

					lowerCamelCase__ :       Tuple						     =			_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





