






from typing import List, Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_herbert import HerbertTokenizer


A_						:						Optional[int]						      =					logging.get_logger(__name__)

A_						:						Optional[Any]						      =					{'vocab_file': 'vocab.json', 'merges_file': 'merges.txt', 'tokenizer_file': 'tokenizer.json'}

A_						:						Dict						      =					{
    'vocab_file': {
        'allegro/herbert-base-cased': 'https://huggingface.co/allegro/herbert-base-cased/resolve/main/vocab.json'
    },
    'merges_file': {
        'allegro/herbert-base-cased': 'https://huggingface.co/allegro/herbert-base-cased/resolve/main/merges.txt'
    },
}

A_						:						Optional[Any]						      =					{'allegro/herbert-base-cased': 514}
A_						:						Dict						      =					{}




class 							_lowerCAmelCase(			UpperCAmelCase_   ):





       """simple docstring"""







       a							:						str										=VOCAB_FILES_NAMES
       a							:						Tuple										=PRETRAINED_VOCAB_FILES_MAP
       a							:						Optional[Any]										=PRETRAINED_INIT_CONFIGURATION
       a							:						List[Any]										=PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       a							:						Optional[Any]										=HerbertTokenizer





       def __init__(   self    ,     _lowerCamelCase=None    ,     _lowerCamelCase=None    ,     _lowerCamelCase=None    ,     _lowerCamelCase="<s>"    ,     _lowerCamelCase="<unk>"    ,     _lowerCamelCase="<pad>"    ,     _lowerCamelCase="<mask>"    ,     _lowerCamelCase="</s>"    ,     **_lowerCamelCase    ,     ):
         super().__init__(
             _lowerCamelCase    ,     _lowerCamelCase    ,     tokenizer_file=_lowerCamelCase    ,     cls_token=_lowerCamelCase    ,     unk_token=_lowerCamelCase    ,     pad_token=_lowerCamelCase    ,     mask_token=_lowerCamelCase    ,     sep_token=_lowerCamelCase    ,     **_lowerCamelCase    ,     )





       def      _a       (   self    ,     _lowerCamelCase    ,     _lowerCamelCase = None				):
         UpperCamelCase_:   List[str]        =							[self.cls_token_id]
         UpperCamelCase_:   List[str]        =							[self.sep_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    ,     _lowerCamelCase    ,     _lowerCamelCase = None    ,     _lowerCamelCase = False				):
         if already_has_special_tokens:
           return super().get_special_tokens_mask(
               token_ids_a=_lowerCamelCase    ,     token_ids_a=_lowerCamelCase    ,     already_has_special_tokens=_lowerCamelCase				)

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





       def      _a       (   self    ,     _lowerCamelCase    ,     _lowerCamelCase = None				):
         UpperCamelCase_:   Any        =							[self.sep_token_id]
         UpperCamelCase_:   Dict        =							[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    ,     _lowerCamelCase    ,     _lowerCamelCase = None				):
         UpperCamelCase_:   Union[str, Any]        =							self._tokenizer.model.save(_lowerCamelCase    ,     name=_lowerCamelCase				)
         return tuple(_lowerCamelCase				)

"""simple docstring"""



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


a       :						Dict       		=		logging.get_logger(__name__)

# TODO: upload to AWS
a       :						Tuple       		=		{
    '''yjernite/retribert-base-uncased''': (
        '''https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/config.json'''
    ),
}




class 		a_    (			_UpperCAmelCase						):
    a   :					int			     =					'retribert'







    def __init__(      self      :							Optional[Any]  ,       __UpperCamelCase      :							Optional[Any]=3_05_22  ,       __UpperCamelCase      :							int=7_68  ,       __UpperCamelCase      :							Any=8  ,       __UpperCamelCase      :							Dict=12  ,       __UpperCamelCase      :							List[Any]=30_72  ,       __UpperCamelCase      :							List[Any]="gelu"  ,       __UpperCamelCase      :							Optional[int]=0.1  ,       __UpperCamelCase      :							int=0.1  ,       __UpperCamelCase      :							Union[str, Any]=5_12  ,       __UpperCamelCase      :							Dict=2  ,       __UpperCamelCase      :							Tuple=0.0_2  ,       __UpperCamelCase      :							List[str]=1e-12  ,       __UpperCamelCase      :							int=True  ,       __UpperCamelCase      :							str=1_28  ,       __UpperCamelCase      :							Union[str, Any]=0  ,       **__UpperCamelCase      :							Any  ,       )		->List[Any]:






        '''simple docstring'''






        super().__init__(pad_token_id=__UpperCamelCase  ,       **__UpperCamelCase  )

        _UpperCAmelCase        = vocab_size
        _UpperCAmelCase        = hidden_size
        _UpperCAmelCase        = num_hidden_layers
        _UpperCAmelCase        = num_attention_heads
        _UpperCAmelCase        = hidden_act
        _UpperCAmelCase        = intermediate_size
        _UpperCAmelCase        = hidden_dropout_prob
        _UpperCAmelCase        = attention_probs_dropout_prob
        _UpperCAmelCase        = max_position_embeddings
        _UpperCAmelCase        = type_vocab_size
        _UpperCAmelCase        = initializer_range
        _UpperCAmelCase        = layer_norm_eps
        _UpperCAmelCase        = share_encoders
        _UpperCAmelCase        = projection_dim