
import functools
import operator

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


__lowerCAmelCase					   =       logging.get_logger(__name__)

__lowerCAmelCase					   =       {
    '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     lowerCamelCase      (       __lowerCamelCase					):
	UpperCamelCase_  :					Union[str, Any]    		=	'wav2vec2'







	def __init__(     self      :str   ,     lowercase      :str=3_2   ,     lowercase      :Any=7_6_8   ,     lowercase      :Tuple=1_2   ,     lowercase      :Dict=1_2   ,     lowercase      :Tuple=3_0_7_2   ,     lowercase      :Optional[Any]="gelu"   ,     lowercase      :Optional[int]=0.1   ,     lowercase      :List[str]=0.1   ,     lowercase      :Union[str, Any]=0.1   ,     lowercase      :List[Any]=0.0   ,     lowercase      :Union[str, Any]=0.0   ,     lowercase      :Union[str, Any]=0.1   ,     lowercase      :int=0.1   ,     lowercase      :List[Any]=0.02   ,     lowercase      :Optional[Any]=1e-5   ,     lowercase      :Tuple="group"   ,     lowercase      :Tuple="gelu"   ,     lowercase      :Optional[int]=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)   ,     lowercase      :Tuple=(5, 2, 2, 2, 2, 2, 2)   ,     lowercase      :str=(1_0, 3, 3, 3, 3, 2, 2)   ,     lowercase      :Any=False   ,     lowercase      :List[Any]=1_2_8   ,     lowercase      :List[str]=1_6   ,     lowercase      :Optional[Any]=False   ,     lowercase      :Tuple=True   ,     lowercase      :Union[str, Any]=0.05   ,     lowercase      :Optional[Any]=1_0   ,     lowercase      :List[str]=2   ,     lowercase      :List[Any]=0.0   ,     lowercase      :List[Any]=1_0   ,     lowercase      :List[Any]=0   ,     lowercase      :Optional[int]=3_2_0   ,     lowercase      :List[str]=2   ,     lowercase      :List[str]=0.1   ,     lowercase      :Tuple=1_0_0   ,     lowercase      :Optional[Any]=2_5_6   ,     lowercase      :Optional[Any]=2_5_6   ,     lowercase      :Optional[Any]=0.1   ,     lowercase      :Optional[Any]="sum"   ,     lowercase      :int=False   ,     lowercase      :Union[str, Any]=False   ,     lowercase      :List[str]=2_5_6   ,     lowercase      :Optional[Any]=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)   ,     lowercase      :List[Any]=(5, 3, 3, 1, 1)   ,     lowercase      :Union[str, Any]=(1, 2, 3, 1, 1)   ,     lowercase      :Tuple=5_1_2   ,     lowercase      :Optional[Any]=0   ,     lowercase      :Tuple=1   ,     lowercase      :List[str]=2   ,     lowercase      :List[str]=False   ,     lowercase      :int=3   ,     lowercase      :Tuple=2   ,     lowercase      :str=3   ,     lowercase      :List[Any]=None   ,     lowercase      :Any=None   ,     **lowercase      :Dict   ,     )		->      Optional[int]:







				"""simple docstring"""






				super().__init__(**lowercase   ,     pad_token_id=lowercase   ,     bos_token_id=lowercase   ,     eos_token_id=lowercase			)
				SCREAMING_SNAKE_CASE     						= hidden_size
				SCREAMING_SNAKE_CASE     						= feat_extract_norm
				SCREAMING_SNAKE_CASE     						= feat_extract_activation
				SCREAMING_SNAKE_CASE     						= list(lowercase			)
				SCREAMING_SNAKE_CASE     						= list(lowercase			)
				SCREAMING_SNAKE_CASE     						= list(lowercase			)
				SCREAMING_SNAKE_CASE     						= conv_bias
				SCREAMING_SNAKE_CASE     						= num_conv_pos_embeddings
				SCREAMING_SNAKE_CASE     						= num_conv_pos_embedding_groups
				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     						= do_stable_layer_norm
				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     						= apply_spec_augment
				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

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

				# 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
				SCREAMING_SNAKE_CASE     						= adapter_attn_dim

				# 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(lowercase			)
				SCREAMING_SNAKE_CASE     						= list(lowercase			)
				SCREAMING_SNAKE_CASE     						= list(lowercase			)
				SCREAMING_SNAKE_CASE     						= xvector_output_dim







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







				"""simple docstring"""






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

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


__lowerCAmelCase					   =       logging.get_logger(__name__)

__lowerCAmelCase					   =       {
    'microsoft/biogpt': 'https://huggingface.co/microsoft/biogpt/resolve/main/config.json',
    # See all BioGPT models at https://huggingface.co/models?filter=biogpt
}





class     lowerCamelCase      (       __lowerCamelCase					):
	UpperCamelCase_  :					Union[str, Any]    		=	'biogpt'







	def __init__(     self      :Tuple   ,     lowercase      :Union[str, Any]=4_2_3_8_4   ,     lowercase      :str=1_0_2_4   ,     lowercase      :Any=2_4   ,     lowercase      :List[str]=1_6   ,     lowercase      :List[str]=4_0_9_6   ,     lowercase      :int="gelu"   ,     lowercase      :List[Any]=0.1   ,     lowercase      :int=0.1   ,     lowercase      :int=1_0_2_4   ,     lowercase      :Optional[Any]=0.02   ,     lowercase      :Union[str, Any]=1e-12   ,     lowercase      :Tuple=True   ,     lowercase      :int=True   ,     lowercase      :Optional[int]=0.0   ,     lowercase      :Any=0.0   ,     lowercase      :str=1   ,     lowercase      :Any=0   ,     lowercase      :int=2   ,     **lowercase      :Tuple   ,     )		->      Optional[int]:







				"""simple docstring"""






				SCREAMING_SNAKE_CASE     						= vocab_size
				SCREAMING_SNAKE_CASE     						= max_position_embeddings
				SCREAMING_SNAKE_CASE     						= hidden_size
				SCREAMING_SNAKE_CASE     						= num_hidden_layers
				SCREAMING_SNAKE_CASE     						= num_attention_heads
				SCREAMING_SNAKE_CASE     						= intermediate_size
				SCREAMING_SNAKE_CASE     						= hidden_act
				SCREAMING_SNAKE_CASE     						= hidden_dropout_prob
				SCREAMING_SNAKE_CASE     						= attention_probs_dropout_prob
				SCREAMING_SNAKE_CASE     						= initializer_range
				SCREAMING_SNAKE_CASE     						= layer_norm_eps
				SCREAMING_SNAKE_CASE     						= scale_embedding
				SCREAMING_SNAKE_CASE     						= use_cache
				SCREAMING_SNAKE_CASE     						= layerdrop
				SCREAMING_SNAKE_CASE     						= activation_dropout
				super().__init__(pad_token_id=lowercase   ,     bos_token_id=lowercase   ,     eos_token_id=lowercase   ,     **lowercase			)