
"""simple docstring"""




import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from .tokenization_lxmert import LxmertTokenizer


UpperCAmelCase__   :					Dict												=				{'vocab_file': 'vocab.txt', 'tokenizer_file': 'tokenizer.json'}

UpperCAmelCase__   :					str												=				{
    'vocab_file': {
        'unc-nlp/lxmert-base-uncased': 'https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/vocab.txt',
    },
    'tokenizer_file': {
        'unc-nlp/lxmert-base-uncased': (
            'https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/tokenizer.json'
        ),
    },
}

UpperCAmelCase__   :					List[Any]												=				{
    'unc-nlp/lxmert-base-uncased': 5_1_2,
}

UpperCAmelCase__   :					Dict												=				{
    'unc-nlp/lxmert-base-uncased': {'do_lower_case': True},
}



class 			lowerCAmelCase_		(a__						):


				"""simple docstring"""



				__UpperCamelCase   :		List[str]       =     VOCAB_FILES_NAMES
				__UpperCamelCase   :		Any       =     PRETRAINED_VOCAB_FILES_MAP
				__UpperCamelCase   :		Any       =     PRETRAINED_INIT_CONFIGURATION
				__UpperCamelCase   :		int       =     PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
				__UpperCamelCase   :		Dict       =     LxmertTokenizer



				def __init__(self     , SCREAMING_SNAKE_CASE__=None     , SCREAMING_SNAKE_CASE__=None     , SCREAMING_SNAKE_CASE__=True     , SCREAMING_SNAKE_CASE__="[UNK]"     , SCREAMING_SNAKE_CASE__="[SEP]"     , SCREAMING_SNAKE_CASE__="[PAD]"     , SCREAMING_SNAKE_CASE__="[CLS]"     , SCREAMING_SNAKE_CASE__="[MASK]"     , SCREAMING_SNAKE_CASE__=True     , SCREAMING_SNAKE_CASE__=None     , **SCREAMING_SNAKE_CASE__     , )      ->	Dict:



											"""simple docstring"""




											super().__init__(
											    SCREAMING_SNAKE_CASE__     , tokenizer_file=SCREAMING_SNAKE_CASE__     , do_lower_case=SCREAMING_SNAKE_CASE__     , unk_token=SCREAMING_SNAKE_CASE__     , sep_token=SCREAMING_SNAKE_CASE__     , pad_token=SCREAMING_SNAKE_CASE__     , cls_token=SCREAMING_SNAKE_CASE__     , mask_token=SCREAMING_SNAKE_CASE__     , tokenize_chinese_chars=SCREAMING_SNAKE_CASE__     , strip_accents=SCREAMING_SNAKE_CASE__     , **SCREAMING_SNAKE_CASE__     , )

											SCREAMING_SNAKE_CASE__		: Any     =     json.loads(self.backend_tokenizer.normalizer.__getstate__()					)
											if (
											    normalizer_state.get("""lowercase"""     , SCREAMING_SNAKE_CASE__					) != do_lower_case
											    or normalizer_state.get("""strip_accents"""     , SCREAMING_SNAKE_CASE__					) != strip_accents
											    or normalizer_state.get("""handle_chinese_chars"""     , SCREAMING_SNAKE_CASE__					) != tokenize_chinese_chars
											):
																		SCREAMING_SNAKE_CASE__		: Union[str, Any]     =     getattr(SCREAMING_SNAKE_CASE__     , normalizer_state.pop("""type"""					)					)
																		SCREAMING_SNAKE_CASE__		: Tuple     =     do_lower_case
																		SCREAMING_SNAKE_CASE__		: Dict     =     strip_accents
																		SCREAMING_SNAKE_CASE__		: Union[str, Any]     =     tokenize_chinese_chars
																		SCREAMING_SNAKE_CASE__		: int     =     normalizer_class(**SCREAMING_SNAKE_CASE__					)

											SCREAMING_SNAKE_CASE__		: Optional[int]     =     do_lower_case



				def 			__magic_name__					(self     , SCREAMING_SNAKE_CASE__     , SCREAMING_SNAKE_CASE__=None					)      ->	List[Any]:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: Dict     =     [self.cls_token_id] + token_ids_a + [self.sep_token_id]

											if token_ids_a:
																		output += token_ids_a + [self.sep_token_id]

											return output



				def 			__magic_name__					(self     , SCREAMING_SNAKE_CASE__     , SCREAMING_SNAKE_CASE__ = None					)      ->	List[int]:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: int     =     [self.sep_token_id]
											SCREAMING_SNAKE_CASE__		: Optional[Any]     =     [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 			__magic_name__					(self     , SCREAMING_SNAKE_CASE__     , SCREAMING_SNAKE_CASE__ = None					)      ->	Tuple[str]:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: Tuple     =     self._tokenizer.model.save(SCREAMING_SNAKE_CASE__     , name=SCREAMING_SNAKE_CASE__					)
											return tuple(SCREAMING_SNAKE_CASE__					)



"""simple docstring"""




import logging

from transformers import PretrainedConfig


UpperCAmelCase__   :					Union[str, Any]												=				logging.getLogger(__name__)


UpperCAmelCase__   :					Any												=				{
    'bertabs-finetuned-cnndm': 'https://huggingface.co/remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization/resolve/main/config.json',
}



class 			lowerCAmelCase_		(a__						):


				"""simple docstring"""



				__UpperCamelCase   :		List[Any]       =     '''bertabs'''



				def __init__(self     , SCREAMING_SNAKE_CASE__=3_05_22     , SCREAMING_SNAKE_CASE__=5_12     , SCREAMING_SNAKE_CASE__=6     , SCREAMING_SNAKE_CASE__=5_12     , SCREAMING_SNAKE_CASE__=8     , SCREAMING_SNAKE_CASE__=5_12     , SCREAMING_SNAKE_CASE__=0.2     , SCREAMING_SNAKE_CASE__=6     , SCREAMING_SNAKE_CASE__=7_68     , SCREAMING_SNAKE_CASE__=8     , SCREAMING_SNAKE_CASE__=20_48     , SCREAMING_SNAKE_CASE__=0.2     , **SCREAMING_SNAKE_CASE__     , )      ->	Union[str, Any]:



											"""simple docstring"""




											super().__init__(**SCREAMING_SNAKE_CASE__					)

											SCREAMING_SNAKE_CASE__		: Optional[Any]     =     vocab_size
											SCREAMING_SNAKE_CASE__		: Any     =     max_pos

											SCREAMING_SNAKE_CASE__		: List[Any]     =     enc_layers
											SCREAMING_SNAKE_CASE__		: Tuple     =     enc_hidden_size
											SCREAMING_SNAKE_CASE__		: Dict     =     enc_heads
											SCREAMING_SNAKE_CASE__		: Optional[Any]     =     enc_ff_size
											SCREAMING_SNAKE_CASE__		: Dict     =     enc_dropout

											SCREAMING_SNAKE_CASE__		: Any     =     dec_layers
											SCREAMING_SNAKE_CASE__		: Union[str, Any]     =     dec_hidden_size
											SCREAMING_SNAKE_CASE__		: Any     =     dec_heads
											SCREAMING_SNAKE_CASE__		: List[Any]     =     dec_ff_size
											SCREAMING_SNAKE_CASE__		: str     =     dec_dropout




