


from typing import List, Optional, Tuple

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


__snake_case   							=						logging.get_logger(__name__)

__snake_case   							=						{'''vocab_file''': '''vocab.json''', '''merges_file''': '''merges.txt''', '''tokenizer_file''': '''tokenizer.json'''}

__snake_case   							=						{
    '''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'''
    },
}

__snake_case   							=						{'''allegro/herbert-base-cased''': 5_1_4}
__snake_case   							=						{}



class 	__lowerCamelCase			(_a						):
       _lowercase											=     VOCAB_FILES_NAMES
       _lowercase											=     PRETRAINED_VOCAB_FILES_MAP
       _lowercase											=     PRETRAINED_INIT_CONFIGURATION
       _lowercase											=     PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       _lowercase											=     HerbertTokenizer







       def __init__(			self: str,A_: str=None,A_: Optional[int]=None,A_: Union[str, Any]=None,A_: Union[str, Any]="<s>",A_: str="<unk>",A_: Optional[Any]="<pad>",A_: Optional[int]="<mask>",A_: Optional[int]="</s>",**A_: Dict,):






            '''simple docstring'''




            super().__init__(
                A_,A_,tokenizer_file=A_,cls_token=A_,unk_token=A_,pad_token=A_,mask_token=A_,sep_token=A_,**A_,)







       def 		snake_case_	(			self: Any,A_: List[int],A_: Optional[List[int]] = None					):






            '''simple docstring'''




            __UpperCamelCase =			[self.cls_token_id]
            __UpperCamelCase =			[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 		snake_case_	(			self: Tuple,A_: List[int],A_: Optional[List[int]] = None,A_: bool = False					):






            '''simple docstring'''




            if already_has_special_tokens:
                 return super().get_special_tokens_mask(
                     token_ids_a=A_,token_ids_a=A_,already_has_special_tokens=A_					)

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







       def 		snake_case_	(			self: Union[str, Any],A_: List[int],A_: Optional[List[int]] = None					):






            '''simple docstring'''




            __UpperCamelCase =			[self.sep_token_id]
            __UpperCamelCase =			[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 		snake_case_	(			self: Any,A_: str,A_: Optional[str] = None					):






            '''simple docstring'''




            __UpperCamelCase =			self._tokenizer.model.save(A_,name=A_					)
            return tuple(A_					)






from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


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

A			:						Tuple        =  {
    'kssteven/ibert-roberta-base': 'https://huggingface.co/kssteven/ibert-roberta-base/resolve/main/config.json',
    'kssteven/ibert-roberta-large': 'https://huggingface.co/kssteven/ibert-roberta-large/resolve/main/config.json',
    'kssteven/ibert-roberta-large-mnli': (
        'https://huggingface.co/kssteven/ibert-roberta-large-mnli/resolve/main/config.json'
    ),
}



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






					A__     =					'''ibert'''

					def __init__(self       :		int ,   _UpperCAmelCase       :		Union[str, Any]=3_0522 ,   _UpperCAmelCase       :		Any=768 ,   _UpperCAmelCase       :		Optional[Any]=12 ,   _UpperCAmelCase       :		Union[str, Any]=12 ,   _UpperCAmelCase       :		List[Any]=3072 ,   _UpperCAmelCase       :		List[Any]="gelu" ,   _UpperCAmelCase       :		List[str]=0.1 ,   _UpperCAmelCase       :		Union[str, Any]=0.1 ,   _UpperCAmelCase       :		Optional[int]=512 ,   _UpperCAmelCase       :		str=2 ,   _UpperCAmelCase       :		Union[str, Any]=0.02 ,   _UpperCAmelCase       :		Dict=1E-1_2 ,   _UpperCAmelCase       :		int=1 ,   _UpperCAmelCase       :		str=0 ,   _UpperCAmelCase       :		Tuple=2 ,   _UpperCAmelCase       :		int="absolute" ,   _UpperCAmelCase       :		Any=False ,   _UpperCAmelCase       :		List[Any]="none" ,   **_UpperCAmelCase       :		List[Any] ,   )		->  Any:




							"""simple docstring"""


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

							lowercase__	     =						vocab_size
							lowercase__	     =						hidden_size
							lowercase__	     =						num_hidden_layers
							lowercase__	     =						num_attention_heads
							lowercase__	     =						hidden_act
							lowercase__	     =						intermediate_size
							lowercase__	     =						hidden_dropout_prob
							lowercase__	     =						attention_probs_dropout_prob
							lowercase__	     =						max_position_embeddings
							lowercase__	     =						type_vocab_size
							lowercase__	     =						initializer_range
							lowercase__	     =						layer_norm_eps
							lowercase__	     =						position_embedding_type
							lowercase__	     =						quant_mode
							lowercase__	     =						force_dequant






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






					@property
					def     lowerCamelCase__	(self       :		Dict						)		->  Mapping[str, Mapping[int, str]]:




							"""simple docstring"""


							if self.task == "multiple-choice":
									lowercase__	     =						{0: """batch""", 1: """choice""", 2: """sequence"""}
							else:
									lowercase__	     =						{0: """batch""", 1: """sequence"""}
							return OrderedDict(
							    [
							        ("""input_ids""", dynamic_axis),
							        ("""attention_mask""", dynamic_axis),
							    ]						)

