


'''simple docstring'''
import functools
import operator

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


__SCREAMING_SNAKE_CASE					:				List[Any]									=		logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE					:				Union[str, Any]									=		{
    '''microsoft/wavlm-base''': '''https://huggingface.co/microsoft/wavlm-base/resolve/main/config.json''',
    # See all WavLM models at https://huggingface.co/models?filter=wavlm
}






class 					__lowerCAmelCase   (   lowercase						):

						"""simple docstring"""






						_UpperCAmelCase		:       List[str]   						="wavlm"






						def __init__(  self							:      Tuple ,  lowerCAmelCase							:      Tuple=32 ,  lowerCAmelCase							:      str=7_68 ,  lowerCAmelCase							:      List[str]=12 ,  lowerCAmelCase							:      Any=12 ,  lowerCAmelCase							:      Tuple=30_72 ,  lowerCAmelCase							:      Tuple="gelu" ,  lowerCAmelCase							:      Union[str, Any]=0.1 ,  lowerCAmelCase							:      Any=0.1 ,  lowerCAmelCase							:      Any=0.1 ,  lowerCAmelCase							:      str=0.0 ,  lowerCAmelCase							:      Tuple=0.1 ,  lowerCAmelCase							:      int=0.1 ,  lowerCAmelCase							:      Optional[Any]=0.0_2 ,  lowerCAmelCase							:      Dict=1e-5 ,  lowerCAmelCase							:      List[Any]="group" ,  lowerCAmelCase							:      List[str]="gelu" ,  lowerCAmelCase							:      Dict=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12) ,  lowerCAmelCase							:      Any=(5, 2, 2, 2, 2, 2, 2) ,  lowerCAmelCase							:      Dict=(10, 3, 3, 3, 3, 2, 2) ,  lowerCAmelCase							:      Tuple=False ,  lowerCAmelCase							:      str=1_28 ,  lowerCAmelCase							:      Optional[Any]=16 ,  lowerCAmelCase							:      Optional[int]=3_20 ,  lowerCAmelCase							:      int=8_00 ,  lowerCAmelCase							:      List[Any]=False ,  lowerCAmelCase							:      Tuple=True ,  lowerCAmelCase							:      Optional[Any]=0.0_5 ,  lowerCAmelCase							:      Dict=10 ,  lowerCAmelCase							:      Union[str, Any]=2 ,  lowerCAmelCase							:      int=0.0 ,  lowerCAmelCase							:      Optional[int]=10 ,  lowerCAmelCase							:      List[Any]=3_20 ,  lowerCAmelCase							:      List[str]=2 ,  lowerCAmelCase							:      Optional[int]=0.1 ,  lowerCAmelCase							:      Optional[Any]=1_00 ,  lowerCAmelCase							:      List[str]=2_56 ,  lowerCAmelCase							:      Tuple=2_56 ,  lowerCAmelCase							:      Any=0.1 ,  lowerCAmelCase							:      Union[str, Any]="mean" ,  lowerCAmelCase							:      Optional[Any]=False ,  lowerCAmelCase							:      Any=False ,  lowerCAmelCase							:      Dict=2_56 ,  lowerCAmelCase							:      Dict=(5_12, 5_12, 5_12, 5_12, 15_00) ,  lowerCAmelCase							:      Tuple=(5, 3, 3, 1, 1) ,  lowerCAmelCase							:      Optional[int]=(1, 2, 3, 1, 1) ,  lowerCAmelCase							:      Tuple=5_12 ,  lowerCAmelCase							:      int=80 ,  lowerCAmelCase							:      Tuple=0 ,  lowerCAmelCase							:      Tuple=1 ,  lowerCAmelCase							:      List[str]=2 ,  lowerCAmelCase							:      Dict=False ,  lowerCAmelCase							:      List[str]=3 ,  lowerCAmelCase							:      List[Any]=2 ,  lowerCAmelCase							:      Dict=3 ,  lowerCAmelCase							:      Union[str, Any]=None ,  **lowerCAmelCase							:      Any ,  ):
													super().__init__(**lowerCAmelCase ,  pad_token_id=lowerCAmelCase ,  bos_token_id=lowerCAmelCase ,  eos_token_id=lowerCAmelCase	)
													A_			    =		hidden_size
													A_			    =		feat_extract_norm
													A_			    =		feat_extract_activation
													A_			    =		list(lowerCAmelCase	)
													A_			    =		list(lowerCAmelCase	)
													A_			    =		list(lowerCAmelCase	)
													A_			    =		conv_bias
													A_			    =		num_buckets
													A_			    =		max_bucket_distance
													A_			    =		num_conv_pos_embeddings
													A_			    =		num_conv_pos_embedding_groups
													A_			    =		len(self.conv_dim	)
													A_			    =		num_hidden_layers
													A_			    =		intermediate_size
													A_			    =		hidden_act
													A_			    =		num_attention_heads
													A_			    =		hidden_dropout
													A_			    =		attention_dropout
													A_			    =		activation_dropout
													A_			    =		feat_proj_dropout
													A_			    =		final_dropout
													A_			    =		layerdrop
													A_			    =		layer_norm_eps
													A_			    =		initializer_range
													A_			    =		num_ctc_classes
													A_			    =		vocab_size
													A_			    =		do_stable_layer_norm
													A_			    =		use_weighted_layer_sum
													A_			    =		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
													A_			    =		apply_spec_augment
													A_			    =		mask_time_prob
													A_			    =		mask_time_length
													A_			    =		mask_time_min_masks
													A_			    =		mask_feature_prob
													A_			    =		mask_feature_length

													# parameters for pretraining with codevector quantized representations
													A_			    =		num_codevectors_per_group
													A_			    =		num_codevector_groups
													A_			    =		contrastive_logits_temperature
													A_			    =		num_negatives
													A_			    =		codevector_dim
													A_			    =		proj_codevector_dim
													A_			    =		diversity_loss_weight

													# ctc loss
													A_			    =		ctc_loss_reduction
													A_			    =		ctc_zero_infinity

													# adapter
													A_			    =		add_adapter
													A_			    =		adapter_kernel_size
													A_			    =		adapter_stride
													A_			    =		num_adapter_layers
													A_			    =		output_hidden_size or hidden_size

													# SequenceClassification-specific parameter. Feel free to ignore for other classes.
													A_			    =		classifier_proj_size

													# XVector-specific parameters. Feel free to ignore for other classes.
													A_			    =		list(lowerCAmelCase	)
													A_			    =		list(lowerCAmelCase	)
													A_			    =		list(lowerCAmelCase	)
													A_			    =		xvector_output_dim






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









'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


__SCREAMING_SNAKE_CASE					:				Optional[int]									=		logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE					:				Union[str, Any]									=		{
    '''tanreinama/GPTSAN-2.8B-spout_is_uniform''': (
        '''https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json'''
    ),
}






class 					__lowerCAmelCase   (   lowercase						):

						"""simple docstring"""






						_UpperCAmelCase		:       Optional[int]   						="gptsan-japanese"
						_UpperCAmelCase		:       Union[str, Any]   						=[
						    "past_key_values",
						]
						_UpperCAmelCase		:       int   						={
						    "hidden_size": "d_model",
						    "num_attention_heads": "num_heads",
						    "num_hidden_layers": "num_layers",
						}






						def __init__(  self							:      List[str] ,  lowerCAmelCase							:      Dict=3_60_00 ,  lowerCAmelCase							:      Union[str, Any]=12_80 ,  lowerCAmelCase							:      Tuple=10_24 ,  lowerCAmelCase							:      Any=81_92 ,  lowerCAmelCase							:      List[str]=40_96 ,  lowerCAmelCase							:      Dict=1_28 ,  lowerCAmelCase							:      int=10 ,  lowerCAmelCase							:      str=0 ,  lowerCAmelCase							:      int=16 ,  lowerCAmelCase							:      int=16 ,  lowerCAmelCase							:      str=1_28 ,  lowerCAmelCase							:      Dict=0.0 ,  lowerCAmelCase							:      List[str]=1e-5 ,  lowerCAmelCase							:      List[str]=False ,  lowerCAmelCase							:      int=0.0 ,  lowerCAmelCase							:      Tuple="float32" ,  lowerCAmelCase							:      Optional[int]=False ,  lowerCAmelCase							:      int=False ,  lowerCAmelCase							:      Tuple=False ,  lowerCAmelCase							:      Optional[Any]=0.0_0_2 ,  lowerCAmelCase							:      Tuple=False ,  lowerCAmelCase							:      str=True ,  lowerCAmelCase							:      Optional[int]=3_59_98 ,  lowerCAmelCase							:      Optional[Any]=3_59_95 ,  lowerCAmelCase							:      Tuple=3_59_99 ,  **lowerCAmelCase							:      Dict ,  ):
													A_			    =		vocab_size
													A_			    =		max_position_embeddings
													A_			    =		d_model
													A_			    =		d_ff
													A_			    =		d_ext
													A_			    =		d_spout
													A_			    =		num_switch_layers
													A_			    =		num_ext_layers
													A_			    =		num_switch_layers + num_ext_layers
													A_			    =		num_heads
													A_			    =		num_experts
													A_			    =		expert_capacity
													A_			    =		dropout_rate
													A_			    =		layer_norm_epsilon
													A_			    =		router_bias
													A_			    =		router_jitter_noise
													A_			    =		router_dtype
													A_			    =		router_ignore_padding_tokens
													A_			    =		output_hidden_states
													A_			    =		output_attentions
													A_			    =		initializer_factor
													A_			    =		output_router_logits
													A_			    =		use_cache

													super().__init__(
													    separator_token_id=lowerCAmelCase ,  pad_token_id=lowerCAmelCase ,  eos_token_id=lowerCAmelCase ,  **lowerCAmelCase ,  )





