


import functools
import operator

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


_UpperCAmelCase      :	Optional[Any]  =logging.get_logger(__name__)

_UpperCAmelCase      :	Any  ={
    """facebook/hubert-base-ls960""": """https://huggingface.co/facebook/hubert-base-ls960/resolve/main/config.json""",
    # See all Hubert models at https://huggingface.co/models?filter=hubert
}







class 					snake_case__(				UpperCAmelCase__				):







						'''simple docstring'''




						SCREAMING_SNAKE_CASE__   :	List[str]       =				"""hubert"""




						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=True ,    __lowercase=0.0 ,    __lowercase=0.1 ,    __lowercase=0.1 ,    __lowercase=0.02 ,    __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.05 ,    __lowercase=1_0 ,    __lowercase=2 ,    __lowercase=0.0 ,    __lowercase=1_0 ,    __lowercase=0 ,    __lowercase="sum" ,    __lowercase=False ,    __lowercase=False ,    __lowercase=2_5_6 ,    __lowercase=0 ,    __lowercase=1 ,    __lowercase=2 ,    **__lowercase ,    )       ->     Any:
										super().__init__(**__lowercase ,    pad_token_id=__lowercase ,    bos_token_id=__lowercase ,    eos_token_id=__lowercase				)
										lowerCAmelCase_			:   str     					=					hidden_size
										lowerCAmelCase_			:   Union[str, Any]     					=					feat_extract_norm
										lowerCAmelCase_			:   str     					=					feat_extract_activation
										lowerCAmelCase_			:   List[Any]     					=					list(__lowercase				)
										lowerCAmelCase_			:   List[str]     					=					list(__lowercase				)
										lowerCAmelCase_			:   List[str]     					=					list(__lowercase				)
										lowerCAmelCase_			:   str     					=					conv_bias
										lowerCAmelCase_			:   Optional[Any]     					=					num_conv_pos_embeddings
										lowerCAmelCase_			:   Dict     					=					num_conv_pos_embedding_groups
										lowerCAmelCase_			:   Dict     					=					len(self.conv_dim				)
										lowerCAmelCase_			:   Any     					=					num_hidden_layers
										lowerCAmelCase_			:   Tuple     					=					intermediate_size
										lowerCAmelCase_			:   List[Any]     					=					hidden_act
										lowerCAmelCase_			:   Tuple     					=					num_attention_heads
										lowerCAmelCase_			:   Optional[Any]     					=					hidden_dropout
										lowerCAmelCase_			:   List[str]     					=					attention_dropout
										lowerCAmelCase_			:   str     					=					activation_dropout
										lowerCAmelCase_			:   Dict     					=					feat_proj_layer_norm
										lowerCAmelCase_			:   Any     					=					feat_proj_dropout
										lowerCAmelCase_			:   Optional[int]     					=					final_dropout
										lowerCAmelCase_			:   Optional[int]     					=					layerdrop
										lowerCAmelCase_			:   Optional[Any]     					=					layer_norm_eps
										lowerCAmelCase_			:   List[Any]     					=					initializer_range
										lowerCAmelCase_			:   List[str]     					=					vocab_size
										lowerCAmelCase_			:   Optional[Any]     					=					do_stable_layer_norm
										lowerCAmelCase_			:   Dict     					=					use_weighted_layer_sum
										lowerCAmelCase_			:   Optional[Any]     					=					classifier_proj_size

										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
										lowerCAmelCase_			:   List[Any]     					=					apply_spec_augment
										lowerCAmelCase_			:   List[Any]     					=					mask_time_prob
										lowerCAmelCase_			:   Optional[Any]     					=					mask_time_length
										lowerCAmelCase_			:   Dict     					=					mask_time_min_masks
										lowerCAmelCase_			:   int     					=					mask_feature_prob
										lowerCAmelCase_			:   Union[str, Any]     					=					mask_feature_length
										lowerCAmelCase_			:   int     					=					mask_feature_min_masks

										# ctc loss
										lowerCAmelCase_			:   Any     					=					ctc_loss_reduction
										lowerCAmelCase_			:   Tuple     					=					ctc_zero_infinity




						@property
						def     lowercase_			(					self				)       ->     Tuple:
										return functools.reduce(operator.mul ,    self.conv_stride ,    1				)



def       lowerCAmelCase			(		lowerCAmelCase_			, lowerCAmelCase_			)->			set:
				assert isinstance(lowerCAmelCase_			, lowerCAmelCase_			), f"""The input value of [set_a={set_a}] is not a set"""
				assert isinstance(lowerCAmelCase_			, lowerCAmelCase_			), f"""The input value of [set_b={set_b}] is not a set"""

				return {a + b for a in set_a for b in set_b}


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

						testmod()