



'''simple docstring'''


import functools
import operator

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


lowerCAmelCase__						:       str										=						logging.get_logger(__name__)

lowerCAmelCase__						:       Any										=						{
    """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     a			(				__lowerCAmelCase       ):






						"""simple docstring"""




						__UpperCAmelCase			     =    '''wav2vec2'''







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



								'''simple docstring'''



								super().__init__(**lowerCAmelCase_			,			pad_token_id=lowerCAmelCase_			,			bos_token_id=lowerCAmelCase_			,			eos_token_id=lowerCAmelCase_  )
								snake_case__						:       Optional[Any]       						=  hidden_size
								snake_case__						:       Union[str, Any]       						=  feat_extract_norm
								snake_case__						:       Any       						=  feat_extract_activation
								snake_case__						:       str       						=  list(lowerCAmelCase_  )
								snake_case__						:       int       						=  list(lowerCAmelCase_  )
								snake_case__						:       Any       						=  list(lowerCAmelCase_  )
								snake_case__						:       Optional[Any]       						=  conv_bias
								snake_case__						:       Tuple       						=  num_conv_pos_embeddings
								snake_case__						:       Union[str, Any]       						=  num_conv_pos_embedding_groups
								snake_case__						:       Optional[Any]       						=  len(self.conv_dim  )
								snake_case__						:       str       						=  num_hidden_layers
								snake_case__						:       Union[str, Any]       						=  intermediate_size
								snake_case__						:       List[Any]       						=  hidden_act
								snake_case__						:       Union[str, Any]       						=  num_attention_heads
								snake_case__						:       Optional[int]       						=  hidden_dropout
								snake_case__						:       Optional[int]       						=  attention_dropout
								snake_case__						:       Tuple       						=  activation_dropout
								snake_case__						:       Optional[Any]       						=  feat_proj_dropout
								snake_case__						:       Optional[Any]       						=  final_dropout
								snake_case__						:       int       						=  layerdrop
								snake_case__						:       List[str]       						=  layer_norm_eps
								snake_case__						:       Union[str, Any]       						=  initializer_range
								snake_case__						:       List[Any]       						=  vocab_size
								snake_case__						:       Optional[int]       						=  do_stable_layer_norm
								snake_case__						:       Optional[int]       						=  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
								snake_case__						:       Tuple       						=  apply_spec_augment
								snake_case__						:       List[str]       						=  mask_time_prob
								snake_case__						:       int       						=  mask_time_length
								snake_case__						:       Optional[int]       						=  mask_time_min_masks
								snake_case__						:       List[Any]       						=  mask_feature_prob
								snake_case__						:       Dict       						=  mask_feature_length
								snake_case__						:       str       						=  mask_feature_min_masks

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

								# ctc loss
								snake_case__						:       Dict       						=  ctc_loss_reduction
								snake_case__						:       Tuple       						=  ctc_zero_infinity

								# adapter
								snake_case__						:       Optional[Any]       						=  add_adapter
								snake_case__						:       int       						=  adapter_kernel_size
								snake_case__						:       List[str]       						=  adapter_stride
								snake_case__						:       Any       						=  num_adapter_layers
								snake_case__						:       str       						=  output_hidden_size or hidden_size
								snake_case__						:       Optional[Any]       						=  adapter_attn_dim

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

								# XVector-specific parameters. Feel free to ignore for other classes.
								snake_case__						:       Optional[Any]       						=  list(lowerCAmelCase_  )
								snake_case__						:       str       						=  list(lowerCAmelCase_  )
								snake_case__						:       Dict       						=  list(lowerCAmelCase_  )
								snake_case__						:       str       						=  xvector_output_dim







						@property
						def       __magic_name__							(							self					:      int  ):



								'''simple docstring'''



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






'''simple docstring'''


from collections.abc import Sequence




def 	_a       (				__lowerCAmelCase		:      Sequence[int] | None = None     ):

		"""simple docstring"""

		if nums is None or not nums:
				raise ValueError('''Input sequence should not be empty'''     )

		snake_case__						:       Optional[Any]       						=  nums[0]
		for i in range(1   ,							len(__lowerCAmelCase     )     ):
				snake_case__						:       Tuple       						=  nums[i]
				snake_case__						:       Optional[int]       						=  max(__lowerCAmelCase   ,							ans + num   ,							__lowerCAmelCase     )

		return ans


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					# Try on a sample input from the user
					lowerCAmelCase__						:       str										=						int(input("""Enter number of elements : """).strip())
					lowerCAmelCase__						:       Dict										=						list(map(int, input("""\nEnter the numbers : """).strip().split()))[:n]
					print(max_subsequence_sum(array))



