





import functools
import operator

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


_UpperCAmelCase										=					logging.get_logger(__name__)

_UpperCAmelCase										=					{
    """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 				_UpperCamelCase       (						lowerCAmelCase_  ):
       _UpperCamelCase					:       Tuple       = """hubert"""

       def __init__(		self:			Any       , _SCREAMING_SNAKE_CASE:			Optional[int]=32       , _SCREAMING_SNAKE_CASE:			List[str]=768       , _SCREAMING_SNAKE_CASE:			Tuple=12       , _SCREAMING_SNAKE_CASE:			Dict=12       , _SCREAMING_SNAKE_CASE:			Dict=3072       , _SCREAMING_SNAKE_CASE:			str="gelu"       , _SCREAMING_SNAKE_CASE:			Optional[Any]=0.1       , _SCREAMING_SNAKE_CASE:			Union[str, Any]=0.1       , _SCREAMING_SNAKE_CASE:			Tuple=0.1       , _SCREAMING_SNAKE_CASE:			Optional[int]=True       , _SCREAMING_SNAKE_CASE:			Any=0.0       , _SCREAMING_SNAKE_CASE:			Union[str, Any]=0.1       , _SCREAMING_SNAKE_CASE:			Tuple=0.1       , _SCREAMING_SNAKE_CASE:			Optional[Any]=0.02       , _SCREAMING_SNAKE_CASE:			Union[str, Any]=1e-5       , _SCREAMING_SNAKE_CASE:			List[Any]="group"       , _SCREAMING_SNAKE_CASE:			List[Any]="gelu"       , _SCREAMING_SNAKE_CASE:			Union[str, Any]=(512, 512, 512, 512, 512, 512, 512)       , _SCREAMING_SNAKE_CASE:			Tuple=(5, 2, 2, 2, 2, 2, 2)       , _SCREAMING_SNAKE_CASE:			Optional[Any]=(10, 3, 3, 3, 3, 2, 2)       , _SCREAMING_SNAKE_CASE:			List[str]=False       , _SCREAMING_SNAKE_CASE:			str=128       , _SCREAMING_SNAKE_CASE:			List[Any]=16       , _SCREAMING_SNAKE_CASE:			Tuple=False       , _SCREAMING_SNAKE_CASE:			Tuple=True       , _SCREAMING_SNAKE_CASE:			int=0.05       , _SCREAMING_SNAKE_CASE:			Tuple=10       , _SCREAMING_SNAKE_CASE:			List[str]=2       , _SCREAMING_SNAKE_CASE:			Optional[int]=0.0       , _SCREAMING_SNAKE_CASE:			Any=10       , _SCREAMING_SNAKE_CASE:			Any=0       , _SCREAMING_SNAKE_CASE:			Tuple="sum"       , _SCREAMING_SNAKE_CASE:			List[str]=False       , _SCREAMING_SNAKE_CASE:			Dict=False       , _SCREAMING_SNAKE_CASE:			Optional[Any]=256       , _SCREAMING_SNAKE_CASE:			List[Any]=0       , _SCREAMING_SNAKE_CASE:			Dict=1       , _SCREAMING_SNAKE_CASE:			List[Any]=2       , **_SCREAMING_SNAKE_CASE:			Dict       , )							->			Dict:




              """simple docstring"""


              super().__init__(**UpperCAmelCase__       , pad_token_id=UpperCAmelCase__       , bos_token_id=UpperCAmelCase__       , eos_token_id=UpperCAmelCase__		)
              UpperCamelCase_ 							=	hidden_size
              UpperCamelCase_ 							=	feat_extract_norm
              UpperCamelCase_ 							=	feat_extract_activation
              UpperCamelCase_ 							=	list(UpperCAmelCase__		)
              UpperCamelCase_ 							=	list(UpperCAmelCase__		)
              UpperCamelCase_ 							=	list(UpperCAmelCase__		)
              UpperCamelCase_ 							=	conv_bias
              UpperCamelCase_ 							=	num_conv_pos_embeddings
              UpperCamelCase_ 							=	num_conv_pos_embedding_groups
              UpperCamelCase_ 							=	len(self.conv_dim		)
              UpperCamelCase_ 							=	num_hidden_layers
              UpperCamelCase_ 							=	intermediate_size
              UpperCamelCase_ 							=	hidden_act
              UpperCamelCase_ 							=	num_attention_heads
              UpperCamelCase_ 							=	hidden_dropout
              UpperCamelCase_ 							=	attention_dropout
              UpperCamelCase_ 							=	activation_dropout
              UpperCamelCase_ 							=	feat_proj_layer_norm
              UpperCamelCase_ 							=	feat_proj_dropout
              UpperCamelCase_ 							=	final_dropout
              UpperCamelCase_ 							=	layerdrop
              UpperCamelCase_ 							=	layer_norm_eps
              UpperCamelCase_ 							=	initializer_range
              UpperCamelCase_ 							=	vocab_size
              UpperCamelCase_ 							=	do_stable_layer_norm
              UpperCamelCase_ 							=	use_weighted_layer_sum
              UpperCamelCase_ 							=	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
              UpperCamelCase_ 							=	apply_spec_augment
              UpperCamelCase_ 							=	mask_time_prob
              UpperCamelCase_ 							=	mask_time_length
              UpperCamelCase_ 							=	mask_time_min_masks
              UpperCamelCase_ 							=	mask_feature_prob
              UpperCamelCase_ 							=	mask_feature_length
              UpperCamelCase_ 							=	mask_feature_min_masks

              # ctc loss
              UpperCamelCase_ 							=	ctc_loss_reduction
              UpperCamelCase_ 							=	ctc_zero_infinity



       @property
       def lowercase			(		self:			Any		)							->			Optional[Any]:




              """simple docstring"""


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




import safs







class 							a__							( safs.SaFileSystem							):







  """simple docstring"""




