

'''simple docstring'''

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


lowercase__         =      logging.get_logger(__name__)

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




class 	A_			(    _snake_case							):






     '''simple docstring'''



     UpperCAmelCase_						:     Union[str, Any]  		=  """gpt_bigcode"""
     UpperCAmelCase_						:     int  		=  ["""past_key_values"""]
     UpperCAmelCase_						:     Dict  		=  {
         """hidden_size""": """n_embd""",
         """max_position_embeddings""": """n_positions""",
         """num_attention_heads""": """n_head""",
         """num_hidden_layers""": """n_layer""",
     }


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

      UpperCAmelCase	:     List[Any]						 =			bos_token_id
      UpperCAmelCase	:     List[Any]						 =			eos_token_id

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



'''simple docstring'''

from __future__ import annotations




def 				UpperCamelCase(					UpperCAmelCase_  ,	UpperCAmelCase_  ,	UpperCAmelCase_     ):
 if len(UpperCAmelCase_     ) == 0:
  raise ValueError('find_max() arg is an empty sequence'     )
 if (
     left >= len(UpperCAmelCase_     )
     or left < -len(UpperCAmelCase_     )
     or right >= len(UpperCAmelCase_     )
     or right < -len(UpperCAmelCase_     )
 ):
  raise IndexError('list index out of range'     )
 if left == right:
  return nums[left]
 UpperCAmelCase	:     Optional[int]						 =			(left + right) >> 1  # the middle
 UpperCAmelCase	:     Any						 =			find_max(UpperCAmelCase_  ,	UpperCAmelCase_  ,	UpperCAmelCase_     )  # find max in range[left, mid]
 UpperCAmelCase	:     Union[str, Any]						 =			find_max(UpperCAmelCase_  ,	mid + 1  ,	UpperCAmelCase_     )  # find max in range[mid + 1, right]

 return left_max if left_max >= right_max else right_max


if __name__ == "__main__":
 import doctest

 doctest.testmod(verbose=True)




