





import math

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


_A					:				int				=			logging.get_logger(__name__)

_A					:				Union[str, 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 					__snake_case	(  __SCREAMING_SNAKE_CASE    ):


    '''simple docstring'''







    lowerCamelCase__    :		Optional[int]				=	"""data2vec-audio"""



    def __init__(       self   ,				A_=32   ,				A_=7_68   ,				A_=12   ,				A_=12   ,				A_=30_72   ,				A_="gelu"   ,				A_=0.1   ,				A_=0.1   ,				A_=0.1   ,				A_=0.0   ,				A_=0.1   ,				A_=0.1   ,				A_=0.02   ,				A_=1E-5   ,				A_="gelu"   ,				A_=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)   ,				A_=(5, 2, 2, 2, 2, 2, 2)   ,				A_=(10, 3, 3, 3, 3, 2, 2)   ,				A_=False   ,				A_=16   ,				A_=19   ,				A_=5   ,				A_=0.05   ,				A_=10   ,				A_=2   ,				A_=0.0   ,				A_=10   ,				A_=0   ,				A_="sum"   ,				A_=False   ,				A_=False   ,				A_=2_56   ,				A_=(5_12, 5_12, 5_12, 5_12, 15_00)   ,				A_=(5, 3, 3, 1, 1)   ,				A_=(1, 2, 3, 1, 1)   ,				A_=5_12   ,				A_=0   ,				A_=1   ,				A_=2   ,				A_=False   ,				A_=3   ,				A_=2   ,				A_=3   ,				A_=None   ,				**A_   ,				):





        '''simple docstring'''

        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_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__											=			conv_pos_kernel_size
        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__											=			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__											=			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

        # 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

        # 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  lowercase_					(       self     ):





        '''simple docstring'''

        return math.prod(self.conv_stride     )





'''simple docstring'''





import argparse
from collections import defaultdict

import yaml


_UpperCamelCase											=		'docs/source/en/_toctree.yml'

def 			a_	(				_lowerCAmelCase			) -> Any:
  __lowerCamelCase			:			Optional[int]       			=					defaultdict(_lowerCAmelCase			)
  __lowerCamelCase			:			Optional[Any]       			=					[]
  __lowerCamelCase			:			Union[str, Any]       			=					[]
  for doc in doc_list:
    if "local" in doc:
      counts[doc["local"]] += 1

    if doc["title"].lower() == "overview":
      overview_doc.append({'local': doc['local'], 'title': doc['title']}			)
    else:
      new_doc_list.append(_lowerCAmelCase			)

  __lowerCamelCase			:			Dict       			=					new_doc_list
  __lowerCamelCase			:			Optional[Any]       			=					[key for key, value in counts.items() if value > 1]

  __lowerCamelCase			:			int       			=					[]
  for duplicate_key in duplicates:
    __lowerCamelCase			:			int       			=					list({doc['title'] for doc in doc_list if doc['local'] == duplicate_key}			)
    if len(_lowerCAmelCase			) > 1:
      raise ValueError(
          F'{duplicate_key} is present several times in the documentation table of content at '
          '`docs/source/en/_toctree.yml` with different *Title* values. Choose one of those and remove the '
          'others.'			)
    # Only add this once
    new_doc.append({'local': duplicate_key, 'title': titles[0]}			)

  # Add none duplicate-keys
  new_doc.extend([doc for doc in doc_list if 'local' not in counts or counts[doc['local']] == 1]			)
  __lowerCamelCase			:			Dict       			=					sorted(_lowerCAmelCase			,key=lambda _lowerCAmelCase			: s["title"].lower()			)

  # "overview" gets special treatment and is always first
  if len(_lowerCAmelCase			) > 1:
    raise ValueError('{doc_list} has two \'overview\' docs which is not allowed.'			)

  overview_doc.extend(_lowerCAmelCase			)

  # Sort
  return overview_doc

def 			a_	(				_lowerCAmelCase=False			) -> Optional[Any]:
  with open(_lowerCAmelCase			,encoding='utf-8'			) as f:
    __lowerCamelCase			:			str       			=					yaml.safe_load(f.read()			)

  # Get to the API doc
  __lowerCamelCase			:			Union[str, Any]       			=					0
  while content[api_idx]["title"] != "API":
    api_idx += 1
  __lowerCamelCase			:			List[str]       			=					content[api_idx]['sections']

  # Then to the model doc
  __lowerCamelCase			:			List[Any]       			=					0
  while api_doc[scheduler_idx]["title"] != "Schedulers":
    scheduler_idx += 1

  __lowerCamelCase			:			List[Any]       			=					api_doc[scheduler_idx]['sections']
  __lowerCamelCase			:			Optional[Any]       			=					clean_doc_toc(_lowerCAmelCase			)

  __lowerCamelCase			:			str       			=					False
  if new_scheduler_doc != scheduler_doc:
    __lowerCamelCase			:			int       			=					True
    if overwrite:
      __lowerCamelCase			:			Any       			=					new_scheduler_doc

  if diff:
    if overwrite:
      __lowerCamelCase			:			Tuple       			=					api_doc
      with open(_lowerCAmelCase			,'w'			,encoding='utf-8'			) as f:
        f.write(yaml.dump(_lowerCAmelCase			,allow_unicode=_lowerCAmelCase			)			)
    else:
      raise ValueError(
          'The model doc part of the table of content is not properly sorted, run `make style` to fix this.'			)

def 			a_	(				_lowerCAmelCase=False			) -> List[Any]:
  with open(_lowerCAmelCase			,encoding='utf-8'			) as f:
    __lowerCamelCase			:			List[str]       			=					yaml.safe_load(f.read()			)

  # Get to the API doc
  __lowerCamelCase			:			List[Any]       			=					0
  while content[api_idx]["title"] != "API":
    api_idx += 1
  __lowerCamelCase			:			Optional[Any]       			=					content[api_idx]['sections']

  # Then to the model doc
  __lowerCamelCase			:			List[Any]       			=					0
  while api_doc[pipeline_idx]["title"] != "Pipelines":
    pipeline_idx += 1

  __lowerCamelCase			:			int       			=					False
  __lowerCamelCase			:			str       			=					api_doc[pipeline_idx]['sections']
  __lowerCamelCase			:			Optional[Any]       			=					[]

  # sort sub pipeline docs
  for pipeline_doc in pipeline_docs:
    if "section" in pipeline_doc:
      __lowerCamelCase			:			str       			=					pipeline_doc['section']
      __lowerCamelCase			:			Optional[Any]       			=					clean_doc_toc(_lowerCAmelCase			)
      if overwrite:
        __lowerCamelCase			:			Union[str, Any]       			=					new_sub_pipeline_doc
    new_pipeline_docs.append(_lowerCAmelCase			)

  # sort overall pipeline doc
  __lowerCamelCase			:			int       			=					clean_doc_toc(_lowerCAmelCase			)

  if new_pipeline_docs != pipeline_docs:
    __lowerCamelCase			:			Tuple       			=					True
    if overwrite:
      __lowerCamelCase			:			int       			=					new_pipeline_docs

  if diff:
    if overwrite:
      __lowerCamelCase			:			Tuple       			=					api_doc
      with open(_lowerCAmelCase			,'w'			,encoding='utf-8'			) as f:
        f.write(yaml.dump(_lowerCAmelCase			,allow_unicode=_lowerCAmelCase			)			)
    else:
      raise ValueError(
          'The model doc part of the table of content is not properly sorted, run `make style` to fix this.'			)


if __name__ == "__main__":
   _UpperCamelCase											=		argparse.ArgumentParser()
   parser.add_argument('--fix_and_overwrite', action='store_true', help='Whether to fix inconsistencies.')
   _UpperCamelCase											=		parser.parse_args()

   check_scheduler_doc(args.fix_and_overwrite)
   check_pipeline_doc(args.fix_and_overwrite)






