




"""simple docstring"""

# Lint as: python3
import itertools
import os
import re


a							      =     re.compile(r'''([A-Z]+)([A-Z][a-z])''')
a							      =     re.compile(r'''([a-z\d])([A-Z])''')

a							      =     re.compile(r'''(?<!_)_(?!_)''')
a							      =     re.compile(r'''(_{2,})''')

a							      =     r'''^\w+(\.\w+)*$'''

a							      =     r'''<>:/\|?*'''






def 		_snake_case	(   _snake_case				:   int				)       ->   List[Any]:






      '''simple docstring'''


      _A     =  _uppercase_uppercase_re.sub(R'\1_\2'							,    _snake_case				)
      _A     =  _lowercase_uppercase_re.sub(R'\1_\2'							,    _snake_case				)
      return name.lower()






def 		_snake_case	(   _snake_case				:   List[str]				)       ->   Optional[int]:






      '''simple docstring'''


      _A     =  _single_underscore_re.split(_snake_case				)
      _A     =  [_multiple_underscores_re.split(_snake_case				) for n in name]
      return "".join(n.capitalize() for n in itertools.chain.from_iterable(_snake_case				) if n != ''				)






def 		_snake_case	(   _snake_case				:   List[str]				)       ->   List[str]:






      '''simple docstring'''


      if os.path.basename(_snake_case				) != name:
            raise ValueError(F'''Should be a dataset name, not a path: {name}'''				)
      return camelcase_to_snakecase(_snake_case				)






def 		_snake_case	(   _snake_case				:   int							,    _snake_case				:   Any				)       ->   Optional[int]:






      '''simple docstring'''


      if os.path.basename(_snake_case				) != name:
            raise ValueError(F'''Should be a dataset name, not a path: {name}'''				)
      if not re.match(_split_re							,    _snake_case				):
            raise ValueError(F'''Split name should match \'{_split_re}\'\' but got \'{split}\'.'''				)
      return F'''{filename_prefix_for_name(_snake_case				)}-{split}'''






def 		_snake_case	(   _snake_case				:   Optional[int]							,    _snake_case				:   str							,    _snake_case				:   int							,    _snake_case				:   Union[str, Any]=None				)       ->   Any:






      '''simple docstring'''


      _A     =  filename_prefix_for_split(_snake_case							,    _snake_case				)
      if filetype_suffix:
            prefix += F'''.{filetype_suffix}'''
      _A     =  os.path.join(_snake_case							,    _snake_case				)
      return F'''{filepath}*'''







def 		_snake_case	(   _snake_case				:   Optional[Any]							,    _snake_case				:   List[str]							,    _snake_case				:   Union[str, Any]							,    _snake_case				:   str=None							,    _snake_case				:   List[Any]=None				)       ->   Dict:






      '''simple docstring'''


      _A     =  filename_prefix_for_split(_snake_case							,    _snake_case				)
      _A     =  os.path.join(_snake_case							,    _snake_case				)

      if shard_lengths:
            _A     =  len(_snake_case				)
            _A     =  [F'''{prefix}-{shard_id:05d}-of-{num_shards:05d}''' for shard_id in range(_snake_case				)]
            if filetype_suffix:
                  _A     =  [filename + F'''.{filetype_suffix}''' for filename in filenames]
            return filenames
      else:
            _A     =  prefix
            if filetype_suffix:
                  filename += F'''.{filetype_suffix}'''
            return [filename]







"""simple docstring"""

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 							lowercase_			(	__lowerCAmelCase				):



 '''simple docstring'''
 UpperCAmelCase       :	int     =      '''gpt_bigcode'''
 UpperCAmelCase       :	str     =      ['''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			:			Tuple       ,				_UpperCAmelCase			:			Dict=50_257       ,				_UpperCAmelCase			:			List[Any]=1_024       ,				_UpperCAmelCase			:			Any=768       ,				_UpperCAmelCase			:			int=12       ,				_UpperCAmelCase			:			Any=12       ,				_UpperCAmelCase			:			Tuple=None       ,				_UpperCAmelCase			:			str="gelu_pytorch_tanh"       ,				_UpperCAmelCase			:			str=0.1       ,				_UpperCAmelCase			:			Optional[Any]=0.1       ,				_UpperCAmelCase			:			Tuple=0.1       ,				_UpperCAmelCase			:			List[Any]=1E-5       ,				_UpperCAmelCase			:			List[Any]=0.02       ,				_UpperCAmelCase			:			Optional[Any]=True       ,				_UpperCAmelCase			:			Dict=True       ,				_UpperCAmelCase			:			List[Any]=50_256       ,				_UpperCAmelCase			:			Dict=50_256       ,				_UpperCAmelCase			:			int=True       ,				_UpperCAmelCase			:			Union[str, Any]=True       ,				_UpperCAmelCase			:			Any=True       ,				**_UpperCAmelCase			:			Any       ,				):
       _A     =  vocab_size
       _A     =  n_positions
       _A     =  n_embd
       _A     =  n_layer
       _A     =  n_head
       _A     =  n_inner
       _A     =  activation_function
       _A     =  resid_pdrop
       _A     =  embd_pdrop
       _A     =  attn_pdrop
       _A     =  layer_norm_epsilon
       _A     =  initializer_range
       _A     =  scale_attn_weights
       _A     =  use_cache
       _A     =  attention_softmax_in_fpaa
       _A     =  scale_attention_softmax_in_fpaa
       _A     =  multi_query

       _A     =  bos_token_id
       _A     =  eos_token_id

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

