





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


A    :					List[str] =      logging.get_logger(__name__)

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


class   A			(SCREAMING_SNAKE_CASE    ):
			'''simple docstring'''




			__lowerCamelCase	:       Any							=    '''gpt_bigcode'''
			__lowerCamelCase	:       List[Any]							=    ['''past_key_values''']
			__lowerCamelCase	:       List[Any]							=    {
			    '''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_02_57							,	__lowerCAmelCase   :    int=10_24							,	__lowerCAmelCase   :    List[str]=7_68							,	__lowerCAmelCase   :    int=12							,	__lowerCAmelCase   :    Tuple=12							,	__lowerCAmelCase   :    Union[str, Any]=None							,	__lowerCAmelCase   :    Optional[int]="gelu_pytorch_tanh"							,	__lowerCAmelCase   :    Any=0.1							,	__lowerCAmelCase   :    List[Any]=0.1							,	__lowerCAmelCase   :    Union[str, Any]=0.1							,	__lowerCAmelCase   :    Dict=1e-5							,	__lowerCAmelCase   :    List[Any]=0.0_2							,	__lowerCAmelCase   :    Optional[Any]=True							,	__lowerCAmelCase   :    List[Any]=True							,	__lowerCAmelCase   :    List[Any]=5_02_56							,	__lowerCAmelCase   :    Any=5_02_56							,	__lowerCAmelCase   :    List[str]=True							,	__lowerCAmelCase   :    Any=True							,	__lowerCAmelCase   :    Optional[Any]=True							,	**__lowerCAmelCase   :    str							,	)	->	Any:







					"""simple docstring"""






					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=__lowerCAmelCase							,	eos_token_id=__lowerCAmelCase							,	**__lowerCAmelCase   )










import os
from shutil import copyfile
from typing import List, Optional, Tuple

from ...tokenization_utils import AddedToken
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import is_sentencepiece_available, logging


if is_sentencepiece_available():
					from .tokenization_albert import AlbertTokenizer
else:
					A    :					Tuple =      None

A    :					Optional[Any] =      logging.get_logger(__name__)
A    :					Tuple =      {'''vocab_file''': '''spiece.model''', '''tokenizer_file''': '''tokenizer.json'''}

A    :					List[str] =      {
    '''vocab_file''': {
        '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/spiece.model''',
        '''albert-large-v1''': '''https://huggingface.co/albert-large-v1/resolve/main/spiece.model''',
        '''albert-xlarge-v1''': '''https://huggingface.co/albert-xlarge-v1/resolve/main/spiece.model''',
        '''albert-xxlarge-v1''': '''https://huggingface.co/albert-xxlarge-v1/resolve/main/spiece.model''',
        '''albert-base-v2''': '''https://huggingface.co/albert-base-v2/resolve/main/spiece.model''',
        '''albert-large-v2''': '''https://huggingface.co/albert-large-v2/resolve/main/spiece.model''',
        '''albert-xlarge-v2''': '''https://huggingface.co/albert-xlarge-v2/resolve/main/spiece.model''',
        '''albert-xxlarge-v2''': '''https://huggingface.co/albert-xxlarge-v2/resolve/main/spiece.model''',
    },
    '''tokenizer_file''': {
        '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/tokenizer.json''',
        '''albert-large-v1''': '''https://huggingface.co/albert-large-v1/resolve/main/tokenizer.json''',
        '''albert-xlarge-v1''': '''https://huggingface.co/albert-xlarge-v1/resolve/main/tokenizer.json''',
        '''albert-xxlarge-v1''': '''https://huggingface.co/albert-xxlarge-v1/resolve/main/tokenizer.json''',
        '''albert-base-v2''': '''https://huggingface.co/albert-base-v2/resolve/main/tokenizer.json''',
        '''albert-large-v2''': '''https://huggingface.co/albert-large-v2/resolve/main/tokenizer.json''',
        '''albert-xlarge-v2''': '''https://huggingface.co/albert-xlarge-v2/resolve/main/tokenizer.json''',
        '''albert-xxlarge-v2''': '''https://huggingface.co/albert-xxlarge-v2/resolve/main/tokenizer.json''',
    },
}

A    :					List[str] =      {
    '''albert-base-v1''': 5_1_2,
    '''albert-large-v1''': 5_1_2,
    '''albert-xlarge-v1''': 5_1_2,
    '''albert-xxlarge-v1''': 5_1_2,
    '''albert-base-v2''': 5_1_2,
    '''albert-large-v2''': 5_1_2,
    '''albert-xlarge-v2''': 5_1_2,
    '''albert-xxlarge-v2''': 5_1_2,
}

A    :					Optional[int] =      '''▁'''


class   A			(SCREAMING_SNAKE_CASE    ):
			'''simple docstring'''




			__lowerCamelCase	:       str							=    VOCAB_FILES_NAMES
			__lowerCamelCase	:       List[Any]							=    PRETRAINED_VOCAB_FILES_MAP
			__lowerCamelCase	:       Dict							=    PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
			__lowerCamelCase	:       List[str]							=    AlbertTokenizer






			def __init__(			self   :    Tuple							,	__lowerCAmelCase   :    Tuple=None							,	__lowerCAmelCase   :    List[str]=None							,	__lowerCAmelCase   :    Optional[Any]=True							,	__lowerCAmelCase   :    List[Any]=True							,	__lowerCAmelCase   :    str=False							,	__lowerCAmelCase   :    Union[str, Any]="[CLS]"							,	__lowerCAmelCase   :    int="[SEP]"							,	__lowerCAmelCase   :    Dict="<unk>"							,	__lowerCAmelCase   :    Dict="[SEP]"							,	__lowerCAmelCase   :    Union[str, Any]="<pad>"							,	__lowerCAmelCase   :    str="[CLS]"							,	__lowerCAmelCase   :    int="[MASK]"							,	**__lowerCAmelCase   :    Optional[Any]							,	)	->	Optional[Any]:







					"""simple docstring"""






					A__        =   (
					    AddedToken(__lowerCAmelCase							,	lstrip=__lowerCAmelCase							,	rstrip=__lowerCAmelCase							,	normalized=__lowerCAmelCase   )
					    if isinstance(__lowerCAmelCase							,	__lowerCAmelCase   )
					    else mask_token
					)

					super().__init__(
					    __lowerCAmelCase							,	tokenizer_file=__lowerCAmelCase							,	do_lower_case=__lowerCAmelCase							,	remove_space=__lowerCAmelCase							,	keep_accents=__lowerCAmelCase							,	bos_token=__lowerCAmelCase							,	eos_token=__lowerCAmelCase							,	unk_token=__lowerCAmelCase							,	sep_token=__lowerCAmelCase							,	pad_token=__lowerCAmelCase							,	cls_token=__lowerCAmelCase							,	mask_token=__lowerCAmelCase							,	**__lowerCAmelCase							,	)

					A__        =   do_lower_case
					A__        =   remove_space
					A__        =   keep_accents
					A__        =   vocab_file
					A__        =   False if not self.vocab_file else True






			def    a_       (			self   :    List[Any]							,	__lowerCAmelCase   :    List[int]							,	__lowerCAmelCase   :    Optional[List[int]] = None   )	->	List[int]:







					"""simple docstring"""






					A__        =   [self.sep_token_id]
					A__        =   [self.cls_token_id]
					if token_ids_a is None:
							return cls + token_ids_a + sep
					return cls + token_ids_a + sep + token_ids_a + sep






			def    a_       (			self   :    Union[str, Any]							,	__lowerCAmelCase   :    List[int]							,	__lowerCAmelCase   :    Optional[List[int]] = None   )	->	List[int]:







					"""simple docstring"""






					A__        =   [self.sep_token_id]
					A__        =   [self.cls_token_id]

					if token_ids_a is None:
							return len(cls + token_ids_a + sep   ) * [0]
					return len(cls + token_ids_a + sep   ) * [0] + len(token_ids_a + sep   ) * [1]







			def    a_       (			self   :    Tuple							,	__lowerCAmelCase   :    str							,	__lowerCAmelCase   :    Optional[str] = None   )	->	Tuple[str]:







					"""simple docstring"""






					if not self.can_save_slow_tokenizer:
							raise ValueError(
							    """Your fast tokenizer does not have the necessary information to save the vocabulary for a slow """
							    """tokenizer."""   )

					if not os.path.isdir(__lowerCAmelCase   ):
							logger.error(f'Vocabulary path ({save_directory}) should be a directory'   )
							return
					A__        =   os.path.join(
					    __lowerCAmelCase							,	(filename_prefix + """-""" if filename_prefix else """""") + VOCAB_FILES_NAMES["""vocab_file"""]   )

					if os.path.abspath(self.vocab_file   ) != os.path.abspath(__lowerCAmelCase   ):
							copyfile(self.vocab_file							,	__lowerCAmelCase   )

					return (out_vocab_file,)



