

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


a_						     =    logging.get_logger(__name__)

a_						     =    {
    'bigcode/gpt_bigcode-santacoder': 'https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json',
}






class _UpperCamelCase							(							__A   ):
			'''simple docstring'''







			lowerCamelCase__           ='gpt_bigcode'
			lowerCamelCase__           =['past_key_values']
			lowerCamelCase__           ={
			    'hidden_size': 'n_embd',
			    'max_position_embeddings': 'n_positions',
			    'num_attention_heads': 'n_head',
			    'num_hidden_layers': 'n_layer',
			}
			def __init__(			self							: Optional[int]      ,      a							: Optional[int]=5_0257      ,      a							: List[str]=1024      ,      a							: Tuple=768      ,      a							: List[Any]=12      ,      a							: int=12      ,      a							: Tuple=None      ,      a							: Any="gelu_pytorch_tanh"      ,      a							: str=0.1      ,      a							: Optional[int]=0.1      ,      a							: str=0.1      ,      a							: List[str]=1e-5      ,      a							: Tuple=0.02      ,      a							: Any=True      ,      a							: str=True      ,      a							: List[Any]=5_0256      ,      a							: Optional[Any]=5_0256      ,      a							: int=True      ,      a							: int=True      ,      a							: Union[str, Any]=True      ,      **a							: Optional[int]      ,      )							->       Any:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE   :      List[Any]				     =       vocab_size
				SCREAMING_SNAKE_CASE   :      int				     =       n_positions
				SCREAMING_SNAKE_CASE   :      Optional[int]				     =       n_embd
				SCREAMING_SNAKE_CASE   :      List[Any]				     =       n_layer
				SCREAMING_SNAKE_CASE   :      Optional[int]				     =       n_head
				SCREAMING_SNAKE_CASE   :      List[Any]				     =       n_inner
				SCREAMING_SNAKE_CASE   :      Any				     =       activation_function
				SCREAMING_SNAKE_CASE   :      Dict				     =       resid_pdrop
				SCREAMING_SNAKE_CASE   :      str				     =       embd_pdrop
				SCREAMING_SNAKE_CASE   :      Optional[Any]				     =       attn_pdrop
				SCREAMING_SNAKE_CASE   :      Any				     =       layer_norm_epsilon
				SCREAMING_SNAKE_CASE   :      Union[str, Any]				     =       initializer_range
				SCREAMING_SNAKE_CASE   :      str				     =       scale_attn_weights
				SCREAMING_SNAKE_CASE   :      int				     =       use_cache
				SCREAMING_SNAKE_CASE   :      List[Any]				     =       attention_softmax_in_fpaa
				SCREAMING_SNAKE_CASE   :      int				     =       scale_attention_softmax_in_fpaa
				SCREAMING_SNAKE_CASE   :      Optional[int]				     =       multi_query

				SCREAMING_SNAKE_CASE   :      int				     =       bos_token_id
				SCREAMING_SNAKE_CASE   :      List[str]				     =       eos_token_id

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


class _UpperCamelCase							:
			'''simple docstring'''







			def __init__(			self							: Optional[Any]      ,      a							: int	)							->       None:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE   :      Tuple				     =       size
				SCREAMING_SNAKE_CASE   :      Union[str, Any]				     =       [0] * size
				SCREAMING_SNAKE_CASE   :      Union[str, Any]				     =       [0] * size
			@staticmethod
			def 							__UpperCamelCase (			a							: int	)							->       int:

				"""simple docstring"""

				return index | (index + 1)
			@staticmethod
			def 							__UpperCamelCase (			a							: int	)							->       int:

				"""simple docstring"""

				return (index & (index + 1)) - 1
			def 							__UpperCamelCase (			self							: Any      ,      a							: int      ,      a							: int	)							->       None:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE   :      Union[str, Any]				     =       value
				while index < self.size:
					SCREAMING_SNAKE_CASE   :      Dict				     =       self.get_prev(a	) + 1
					if current_left_border == index:
						SCREAMING_SNAKE_CASE   :      Optional[int]				     =       value
					else:
						SCREAMING_SNAKE_CASE   :      Tuple				     =       max(a      ,      a      ,      a	)
					SCREAMING_SNAKE_CASE   :      Optional[Any]				     =       self.get_next(a	)






			def 							__UpperCamelCase (			self							: Optional[int]      ,      a							: int      ,      a							: int	)							->       int:

				"""simple docstring"""

				right -= 1  # Because of right is exclusive
				SCREAMING_SNAKE_CASE   :      Optional[int]				     =       0
				while left <= right:
					SCREAMING_SNAKE_CASE   :      List[Any]				     =       self.get_prev(a	)
					if left <= current_left:
						SCREAMING_SNAKE_CASE   :      List[Any]				     =       max(a      ,      self.tree[right]	)
						SCREAMING_SNAKE_CASE   :      str				     =       current_left
					else:
						SCREAMING_SNAKE_CASE   :      List[str]				     =       max(a      ,      self.arr[right]	)
						right -= 1
				return result


if __name__ == "__main__":
			import doctest

			doctest.testmod()