






'''simple docstring'''







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


_A	:			Tuple         =logging.get_logger(__name__)

_A	:			Optional[int]         ={
    '''bigcode/gpt_bigcode-santacoder''': '''https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json''',
}

class _lowercase	(				_lowercase		):
							a				      =       """gpt_bigcode"""
							a				      =       ["""past_key_values"""]
							a				      =       {
							    """hidden_size""": """n_embd""",
							    """max_position_embeddings""": """n_positions""",
							    """num_attention_heads""": """n_head""",
							    """num_hidden_layers""": """n_layer""",
							}




							def __init__(							self:				Dict			,							UpperCamelCase__:				Optional[Any]=50_257			,							UpperCamelCase__:				Union[str, Any]=1_024			,							UpperCamelCase__:				List[str]=768			,							UpperCamelCase__:				Tuple=12			,							UpperCamelCase__:				Any=12			,							UpperCamelCase__:				Dict=None			,							UpperCamelCase__:				Optional[int]="gelu_pytorch_tanh"			,							UpperCamelCase__:				Any=0.1			,							UpperCamelCase__:				Optional[Any]=0.1			,							UpperCamelCase__:				Union[str, Any]=0.1			,							UpperCamelCase__:				List[Any]=1e-5			,							UpperCamelCase__:				str=0.02			,							UpperCamelCase__:				Union[str, Any]=True			,							UpperCamelCase__:				Optional[Any]=True			,							UpperCamelCase__:				Dict=50_256			,							UpperCamelCase__:				Tuple=50_256			,							UpperCamelCase__:				Optional[int]=True			,							UpperCamelCase__:				Any=True			,							UpperCamelCase__:				int=True			,							**UpperCamelCase__:				Tuple			,							):
														lowerCamelCase__					:	str         =       vocab_size
														lowerCamelCase__					:	str         =       n_positions
														lowerCamelCase__					:	Union[str, Any]         =       n_embd
														lowerCamelCase__					:	Optional[Any]         =       n_layer
														lowerCamelCase__					:	int         =       n_head
														lowerCamelCase__					:	List[str]         =       n_inner
														lowerCamelCase__					:	Optional[Any]         =       activation_function
														lowerCamelCase__					:	int         =       resid_pdrop
														lowerCamelCase__					:	List[str]         =       embd_pdrop
														lowerCamelCase__					:	Union[str, Any]         =       attn_pdrop
														lowerCamelCase__					:	Optional[int]         =       layer_norm_epsilon
														lowerCamelCase__					:	Any         =       initializer_range
														lowerCamelCase__					:	List[Any]         =       scale_attn_weights
														lowerCamelCase__					:	Any         =       use_cache
														lowerCamelCase__					:	Union[str, Any]         =       attention_softmax_in_fpaa
														lowerCamelCase__					:	str         =       scale_attention_softmax_in_fpaa
														lowerCamelCase__					:	List[str]         =       multi_query

														lowerCamelCase__					:	List[str]         =       bos_token_id
														lowerCamelCase__					:	Union[str, Any]         =       eos_token_id

														super().__init__(bos_token_id=UpperCamelCase__			,							eos_token_id=UpperCamelCase__			,							**UpperCamelCase__     )









'''simple docstring'''







class _lowercase	:




							def __init__(							self:				Tuple			,							UpperCamelCase__:				list[int]     ):
														lowerCamelCase__					:	Union[str, Any]         =       len(UpperCamelCase__     )
														lowerCamelCase__					:	Union[str, Any]         =       [0] * len_array

														if len_array > 0:
																					lowerCamelCase__					:	Union[str, Any]         =       array[0]

														for i in range(1			,							UpperCamelCase__     ):
																					lowerCamelCase__					:	Tuple         =       self.prefix_sum[i - 1] + array[i]




							def 		lowerCamelCase_				(							self:				Tuple			,							UpperCamelCase__:				int			,							UpperCamelCase__:				int     ):
														if start == 0:
																					return self.prefix_sum[end]

														return self.prefix_sum[end] - self.prefix_sum[start - 1]




							def 		lowerCamelCase_				(							self:				Optional[int]			,							UpperCamelCase__:				int     ):
														lowerCamelCase__					:	Dict         =       {0}
														for sum_item in self.prefix_sum:
																					if sum_item - target_sum in sums:
																												return True

																					sums.add(UpperCamelCase__     )

														return False


if __name__ == "__main__":
			import doctest

			doctest.testmod()

