



import functools
import operator

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


_lowercase						: Any     						=logging.get_logger(__name__)

_lowercase						: Tuple     						={
    "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__						):







						"""simple docstring"""




						__lowerCAmelCase	:List[Any]         =	"""wav2vec2"""

						def __init__(  self   ,  __lowercase=3_2   ,  __lowercase=7_6_8   ,  __lowercase=1_2   ,  __lowercase=1_2   ,  __lowercase=3_0_7_2   ,  __lowercase="gelu"   ,  __lowercase=0.1   ,  __lowercase=0.1   ,  __lowercase=0.1   ,  __lowercase=0.0   ,  __lowercase=0.0   ,  __lowercase=0.1   ,  __lowercase=0.1   ,  __lowercase=0.0_2   ,  __lowercase=1E-5   ,  __lowercase="group"   ,  __lowercase="gelu"   ,  __lowercase=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)   ,  __lowercase=(5, 2, 2, 2, 2, 2, 2)   ,  __lowercase=(1_0, 3, 3, 3, 3, 2, 2)   ,  __lowercase=False   ,  __lowercase=1_2_8   ,  __lowercase=1_6   ,  __lowercase=False   ,  __lowercase=True   ,  __lowercase=0.0_5   ,  __lowercase=1_0   ,  __lowercase=2   ,  __lowercase=0.0   ,  __lowercase=1_0   ,  __lowercase=0   ,  __lowercase=3_2_0   ,  __lowercase=2   ,  __lowercase=0.1   ,  __lowercase=1_0_0   ,  __lowercase=2_5_6   ,  __lowercase=2_5_6   ,  __lowercase=0.1   ,  __lowercase="sum"   ,  __lowercase=False   ,  __lowercase=False   ,  __lowercase=2_5_6   ,  __lowercase=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)   ,  __lowercase=(5, 3, 3, 1, 1)   ,  __lowercase=(1, 2, 3, 1, 1)   ,  __lowercase=5_1_2   ,  __lowercase=0   ,  __lowercase=1   ,  __lowercase=2   ,  __lowercase=False   ,  __lowercase=3   ,  __lowercase=2   ,  __lowercase=3   ,  __lowercase=None   ,  __lowercase=None   ,  **__lowercase   ,  )   -> List[str]:
									"""simple docstring"""




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

									# parameters for pretraining with codevector quantized representations
									a__  :		Optional[Any]					=    num_codevectors_per_group
									a__  :		Optional[Any]					=    num_codevector_groups
									a__  :		Optional[int]					=    contrastive_logits_temperature
									a__  :		List[Any]					=    feat_quantizer_dropout
									a__  :		Optional[int]					=    num_negatives
									a__  :		Any					=    codevector_dim
									a__  :		List[Any]					=    proj_codevector_dim
									a__  :		str					=    diversity_loss_weight

									# ctc loss
									a__  :		Tuple					=    ctc_loss_reduction
									a__  :		Optional[int]					=    ctc_zero_infinity

									# adapter
									a__  :		Dict					=    add_adapter
									a__  :		Optional[int]					=    adapter_kernel_size
									a__  :		Dict					=    adapter_stride
									a__  :		List[str]					=    num_adapter_layers
									a__  :		Any					=    output_hidden_size or hidden_size
									a__  :		Any					=    adapter_attn_dim

									# SequenceClassification-specific parameter. Feel free to ignore for other classes.
									a__  :		Optional[Any]					=    classifier_proj_size

									# XVector-specific parameters. Feel free to ignore for other classes.
									a__  :		Optional[int]					=    list(__UpperCAmelCase    )
									a__  :		Optional[Any]					=    list(__UpperCAmelCase    )
									a__  :		Optional[Any]					=    list(__UpperCAmelCase    )
									a__  :		Dict					=    xvector_output_dim

						@property
						def 				SCREAMING_SNAKE_CASE__(  self    )   -> List[str]:
									"""simple docstring"""




									return functools.reduce(operator.mul   ,  self.conv_stride   ,  1    )











"""simple docstring"""





def 					__A  (_SCREAMING_SNAKE_CASE     )   ->str:





  """simple docstring"""


  lowerCAmelCase__     :List[Any]											=				int(_SCREAMING_SNAKE_CASE     )
  if decimal in (0, 1):  # Exit cases for the recursion
    return str(_SCREAMING_SNAKE_CASE     )
  lowerCAmelCase__				,							lowerCAmelCase__     :int											=				divmod(_SCREAMING_SNAKE_CASE	,  2     )
  return binary_recursive(_SCREAMING_SNAKE_CASE     ) + str(_SCREAMING_SNAKE_CASE     )
def 					__A  (_SCREAMING_SNAKE_CASE     )   ->str:





  """simple docstring"""


  lowerCAmelCase__     :str											=				str(_SCREAMING_SNAKE_CASE     ).strip()
  if not number:
    raise ValueError('No input value was provided'     )
  lowerCAmelCase__     :Dict											=				'-' if number.startswith('-'     ) else ''
  lowerCAmelCase__     :int											=				number.lstrip('-'     )
  if not number.isnumeric():
    raise ValueError('Input value is not an integer'     )
  return F"{negative}0b{binary_recursive(int(_SCREAMING_SNAKE_CASE     )     )}"


if __name__ == "__main__":
  from doctest import testmod

  testmod()
