


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


SCREAMING_SNAKE_CASE						:Optional[Any]			=  logging.get_logger(__name__)

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


class      __lowerCAmelCase  (			a       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							'gpt_bigcode'
  _SCREAMING_SNAKE_CASE		     =							['past_key_values']
  _SCREAMING_SNAKE_CASE		     =							{
      'hidden_size': 'n_embd',
      'max_position_embeddings': 'n_positions',
      'num_attention_heads': 'n_head',
      'num_hidden_layers': 'n_layer',
  }



  def __init__(  self							:							str     ,					_lowerCAmelCase							:							List[str]=5_0_2_5_7     ,					_lowerCAmelCase							:							List[str]=1_0_2_4     ,					_lowerCAmelCase							:							Optional[int]=7_6_8     ,					_lowerCAmelCase							:							Dict=1_2     ,					_lowerCAmelCase							:							List[Any]=1_2     ,					_lowerCAmelCase							:							int=None     ,					_lowerCAmelCase							:							List[str]="gelu_pytorch_tanh"     ,					_lowerCAmelCase							:							Optional[int]=0.1     ,					_lowerCAmelCase							:							Optional[int]=0.1     ,					_lowerCAmelCase							:							Any=0.1     ,					_lowerCAmelCase							:							str=1e-5     ,					_lowerCAmelCase							:							Union[str, Any]=0.02     ,					_lowerCAmelCase							:							Optional[Any]=True     ,					_lowerCAmelCase							:							Optional[Any]=True     ,					_lowerCAmelCase							:							Optional[Any]=5_0_2_5_6     ,					_lowerCAmelCase							:							List[Any]=5_0_2_5_6     ,					_lowerCAmelCase							:							Any=True     ,					_lowerCAmelCase							:							Union[str, Any]=True     ,					_lowerCAmelCase							:							str=True     ,					**_lowerCAmelCase							:							List[Any]     ,					) ->			Tuple:




     """simple docstring"""
     snake_case_            =       vocab_size
     snake_case_            =       n_positions
     snake_case_            =       n_embd
     snake_case_            =       n_layer
     snake_case_            =       n_head
     snake_case_            =       n_inner
     snake_case_            =       activation_function
     snake_case_            =       resid_pdrop
     snake_case_            =       embd_pdrop
     snake_case_            =       attn_pdrop
     snake_case_            =       layer_norm_epsilon
     snake_case_            =       initializer_range
     snake_case_            =       scale_attn_weights
     snake_case_            =       use_cache
     snake_case_            =       attention_softmax_in_fpaa
     snake_case_            =       scale_attention_softmax_in_fpaa
     snake_case_            =       multi_query

     snake_case_            =       bos_token_id
     snake_case_            =       eos_token_id

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








from __future__ import annotations



def       _lowerCAmelCase    (				lowerCAmelCase_				:int		,    lowerCAmelCase_				:int				)->list[str]:
   '''simple docstring'''






   if partitions <= 0:
      raise ValueError("partitions must be a positive number!"				)
   if partitions > number_of_bytes:
      raise ValueError("partitions can not > number_of_bytes!"				)
   snake_case_            =       number_of_bytes // partitions
   snake_case_            =       []
   for i in range(lowerCAmelCase_				):
      snake_case_            =       i * bytes_per_partition + 1
      snake_case_            =       (
          number_of_bytes if i == partitions - 1 else (i + 1) * bytes_per_partition
      )
      allocation_list.append(F'''{start_bytes}-{end_bytes}'''				)
   return allocation_list


if __name__ == "__main__":
   import doctest

   doctest.testmod()




