




import functools
import operator

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


__lowerCamelCase   :						Any				=			logging.get_logger(__name__)

__lowerCamelCase   :						str				=			{
    '''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						):






			'''simple docstring'''





			UpperCamelCase__								='''wav2vec2'''

			def __init__( self			:   Optional[int]       ,						lowerCamelCase_			:   Union[str, Any]=32       ,						lowerCamelCase_			:   Tuple=768       ,						lowerCamelCase_			:   int=12       ,						lowerCamelCase_			:   Dict=12       ,						lowerCamelCase_			:   Union[str, Any]=3072       ,						lowerCamelCase_			:   int="gelu"       ,						lowerCamelCase_			:   List[str]=0.1       ,						lowerCamelCase_			:   Dict=0.1       ,						lowerCamelCase_			:   Union[str, Any]=0.1       ,						lowerCamelCase_			:   str=0.0       ,						lowerCamelCase_			:   Union[str, Any]=0.0       ,						lowerCamelCase_			:   Optional[int]=0.1       ,						lowerCamelCase_			:   Tuple=0.1       ,						lowerCamelCase_			:   Optional[int]=0.0_2       ,						lowerCamelCase_			:   Dict=1E-5       ,						lowerCamelCase_			:   List[Any]="group"       ,						lowerCamelCase_			:   List[Any]="gelu"       ,						lowerCamelCase_			:   str=(512, 512, 512, 512, 512, 512, 512)       ,						lowerCamelCase_			:   Dict=(5, 2, 2, 2, 2, 2, 2)       ,						lowerCamelCase_			:   Dict=(10, 3, 3, 3, 3, 2, 2)       ,						lowerCamelCase_			:   Any=False       ,						lowerCamelCase_			:   Optional[int]=128       ,						lowerCamelCase_			:   Optional[Any]=16       ,						lowerCamelCase_			:   List[str]=False       ,						lowerCamelCase_			:   str=True       ,						lowerCamelCase_			:   Optional[Any]=0.0_5       ,						lowerCamelCase_			:   Union[str, Any]=10       ,						lowerCamelCase_			:   List[str]=2       ,						lowerCamelCase_			:   int=0.0       ,						lowerCamelCase_			:   Optional[int]=10       ,						lowerCamelCase_			:   Optional[int]=0       ,						lowerCamelCase_			:   Optional[int]=320       ,						lowerCamelCase_			:   List[str]=2       ,						lowerCamelCase_			:   int=0.1       ,						lowerCamelCase_			:   Dict=100       ,						lowerCamelCase_			:   Dict=256       ,						lowerCamelCase_			:   int=256       ,						lowerCamelCase_			:   Optional[Any]=0.1       ,						lowerCamelCase_			:   Tuple="sum"       ,						lowerCamelCase_			:   Optional[int]=False       ,						lowerCamelCase_			:   Dict=False       ,						lowerCamelCase_			:   Union[str, Any]=256       ,						lowerCamelCase_			:   Any=(512, 512, 512, 512, 1500)       ,						lowerCamelCase_			:   Optional[int]=(5, 3, 3, 1, 1)       ,						lowerCamelCase_			:   List[str]=(1, 2, 3, 1, 1)       ,						lowerCamelCase_			:   Any=512       ,						lowerCamelCase_			:   str=0       ,						lowerCamelCase_			:   List[str]=1       ,						lowerCamelCase_			:   Any=2       ,						lowerCamelCase_			:   str=False       ,						lowerCamelCase_			:   List[str]=3       ,						lowerCamelCase_			:   List[Any]=2       ,						lowerCamelCase_			:   str=3       ,						lowerCamelCase_			:   Any=None       ,						lowerCamelCase_			:   Optional[int]=None       ,						**lowerCamelCase_			:   Any       ,						)						->   List[Any]:
								super().__init__(**lowerCamelCase_       ,						pad_token_id=lowerCamelCase_       ,						bos_token_id=lowerCamelCase_       ,						eos_token_id=lowerCamelCase_  )
								__magic_name__							:	Any    							=							hidden_size
								__magic_name__							:	Dict    							=							feat_extract_norm
								__magic_name__							:	Tuple    							=							feat_extract_activation
								__magic_name__							:	Tuple    							=							list(lowerCamelCase_  )
								__magic_name__							:	List[str]    							=							list(lowerCamelCase_  )
								__magic_name__							:	int    							=							list(lowerCamelCase_  )
								__magic_name__							:	Dict    							=							conv_bias
								__magic_name__							:	Tuple    							=							num_conv_pos_embeddings
								__magic_name__							:	Optional[int]    							=							num_conv_pos_embedding_groups
								__magic_name__							:	List[Any]    							=							len(self.conv_dim  )
								__magic_name__							:	Optional[Any]    							=							num_hidden_layers
								__magic_name__							:	Optional[Any]    							=							intermediate_size
								__magic_name__							:	Any    							=							hidden_act
								__magic_name__							:	Union[str, Any]    							=							num_attention_heads
								__magic_name__							:	Optional[int]    							=							hidden_dropout
								__magic_name__							:	List[Any]    							=							attention_dropout
								__magic_name__							:	Optional[int]    							=							activation_dropout
								__magic_name__							:	int    							=							feat_proj_dropout
								__magic_name__							:	Optional[Any]    							=							final_dropout
								__magic_name__							:	int    							=							layerdrop
								__magic_name__							:	int    							=							layer_norm_eps
								__magic_name__							:	Union[str, Any]    							=							initializer_range
								__magic_name__							:	Optional[Any]    							=							vocab_size
								__magic_name__							:	Any    							=							do_stable_layer_norm
								__magic_name__							:	Dict    							=							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
								__magic_name__							:	Union[str, Any]    							=							apply_spec_augment
								__magic_name__							:	Any    							=							mask_time_prob
								__magic_name__							:	List[Any]    							=							mask_time_length
								__magic_name__							:	Tuple    							=							mask_time_min_masks
								__magic_name__							:	int    							=							mask_feature_prob
								__magic_name__							:	str    							=							mask_feature_length
								__magic_name__							:	Optional[int]    							=							mask_feature_min_masks

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

								# ctc loss
								__magic_name__							:	Optional[int]    							=							ctc_loss_reduction
								__magic_name__							:	str    							=							ctc_zero_infinity

								# adapter
								__magic_name__							:	Union[str, Any]    							=							add_adapter
								__magic_name__							:	List[str]    							=							adapter_kernel_size
								__magic_name__							:	Any    							=							adapter_stride
								__magic_name__							:	Tuple    							=							num_adapter_layers
								__magic_name__							:	Tuple    							=							output_hidden_size or hidden_size
								__magic_name__							:	List[str]    							=							adapter_attn_dim

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

								# XVector-specific parameters. Feel free to ignore for other classes.
								__magic_name__							:	Any    							=							list(lowerCamelCase_  )
								__magic_name__							:	Tuple    							=							list(lowerCamelCase_  )
								__magic_name__							:	Optional[Any]    							=							list(lowerCamelCase_  )
								__magic_name__							:	Optional[Any]    							=							xvector_output_dim


			@property
			def 							UpperCAmelCase__       ( self			:   Optional[int]  )						->   str:
								return functools.reduce(operator.mul       ,						self.conv_stride       ,						1  )









import requests







def 		lowercase__   (		__A:	str							,__A:	str				):





					'''simple docstring'''






					__magic_name__							:	Tuple    							=							{'''Content-Type''': '''application/json'''}
					__magic_name__							:	Union[str, Any]    							=							requests.post(__A							,json={'''text''': message_body}							,headers=__A				)
					if response.status_code != 2_0_0:
										__magic_name__							:	int    							=							(
										    '''Request to slack returned an error '''
										    F'''{response.status_code}, the response is:\n{response.text}'''
										)
										raise ValueError(__A				)


if __name__ == "__main__":
	# Set the slack url to the one provided by Slack when you create the webhook at
	# https://my.slack.com/services/new/incoming-webhook/
	send_slack_message('''<YOUR MESSAGE BODY>''', '''<SLACK CHANNEL URL>''')



