

import math

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


__snake_case							:	int											=       logging.get_logger(__name__)

__snake_case							:	Any											=       {
    """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__(a_				):
						"""simple docstring"""






						_A  :							Dict     =       '''data2vec-audio'''





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

									# ctc loss
									a_		:		Dict      				=      ctc_loss_reduction
									a_		:		List[str]      				=      ctc_zero_infinity

									# adapter
									a_		:		int      				=      add_adapter
									a_		:		Optional[Any]      				=      adapter_kernel_size
									a_		:		int      				=      adapter_stride
									a_		:		Dict      				=      num_adapter_layers
									a_		:		int      				=      output_hidden_size or hidden_size

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

									# XVector-specific parameters. Feel free to ignore for other classes.
									a_		:		int      				=      list(_lowercase  )
									a_		:		Union[str, Any]      				=      list(_lowercase  )
									a_		:		Optional[Any]      				=      list(_lowercase  )
									a_		:		Tuple      				=      xvector_output_dim





						@property
						def        UpperCamelCase__ (  self  )			->      int:
									return math.prod(self.conv_stride  )






# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


UpperCAmelCase__   	=							{
    '''configuration_efficientnet''': [
        '''EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''EfficientNetConfig''',
        '''EfficientNetOnnxConfig''',
    ]
}

try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase__   	=							['''EfficientNetImageProcessor''']

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase__   	=							[
      '''EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''EfficientNetForImageClassification''',
      '''EfficientNetModel''',
      '''EfficientNetPreTrainedModel''',
  ]

if TYPE_CHECKING:
  from .configuration_efficientnet import (
      EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP,
      EfficientNetConfig,
      EfficientNetOnnxConfig,
  )

  try:
    if not is_vision_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .image_processing_efficientnet import EfficientNetImageProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_efficientnet import (
        EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST,
        EfficientNetForImageClassification,
        EfficientNetModel,
        EfficientNetPreTrainedModel,
    )

else:
  import sys

  UpperCAmelCase__   	=							_LazyModule(__name__, globals()['''__file__'''], _import_structure)

