






import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_squeezebert import SqueezeBertTokenizer


__lowerCamelCase   :     Optional[Any] 		= logging.get_logger(__name__)

__lowerCamelCase   :     Tuple 		= {"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

__lowerCamelCase   :     Any 		= {
    """vocab_file""": {
        """squeezebert/squeezebert-uncased""": (
            """https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/vocab.txt"""
        ),
        """squeezebert/squeezebert-mnli""": """https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/vocab.txt""",
        """squeezebert/squeezebert-mnli-headless""": (
            """https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/vocab.txt"""
        ),
    },
    """tokenizer_file""": {
        """squeezebert/squeezebert-uncased""": (
            """https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/tokenizer.json"""
        ),
        """squeezebert/squeezebert-mnli""": (
            """https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/tokenizer.json"""
        ),
        """squeezebert/squeezebert-mnli-headless""": (
            """https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/tokenizer.json"""
        ),
    },
}

__lowerCamelCase   :     List[Any] 		= {
    """squeezebert/squeezebert-uncased""": 512,
    """squeezebert/squeezebert-mnli""": 512,
    """squeezebert/squeezebert-mnli-headless""": 512,
}


__lowerCamelCase   :     List[str] 		= {
    """squeezebert/squeezebert-uncased""": {"""do_lower_case""": True},
    """squeezebert/squeezebert-mnli""": {"""do_lower_case""": True},
    """squeezebert/squeezebert-mnli-headless""": {"""do_lower_case""": True},
}



class 				SCREAMING_SNAKE_CASE__		(							_a		):





					"""simple docstring"""






					a_      =						VOCAB_FILES_NAMES
					a_      =						PRETRAINED_VOCAB_FILES_MAP
					a_      =						PRETRAINED_INIT_CONFIGURATION
					a_      =						PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
					a_      =						SqueezeBertTokenizer



					def __init__(   self	:    Dict				,						__A	:    int=None				,						__A	:    int=None				,						__A	:    List[Any]=True				,						__A	:    Any="[UNK]"				,						__A	:    List[Any]="[SEP]"				,						__A	:    int="[PAD]"				,						__A	:    Optional[Any]="[CLS]"				,						__A	:    List[str]="[MASK]"				,						__A	:    int=True				,						__A	:    Dict=None				,						**__A	:    int				,						):
						super().__init__(
						    A_				,						tokenizer_file=A_				,						do_lower_case=A_				,						unk_token=A_				,						sep_token=A_				,						pad_token=A_				,						cls_token=A_				,						mask_token=A_				,						tokenize_chinese_chars=A_				,						strip_accents=A_				,						**A_				,						)

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

						snake_case__					: int  =    do_lower_case



					def 			_lowercase	(   self	:    Dict				,						__A	:    Tuple				,						__A	:    Union[str, Any]=None			):
						snake_case__					: Optional[Any]  =    [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 			_lowercase	(   self	:    Any				,						__A	:    List[int]				,						__A	:    Optional[List[int]] = None			):
						snake_case__					: List[Any]  =    [self.sep_token_id]
						snake_case__					: Union[str, 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 			_lowercase	(   self	:    Union[str, Any]				,						__A	:    str				,						__A	:    Optional[str] = None			):
						snake_case__					: List[str]  =    self._tokenizer.model.save(A_				,						name=A_			)
						return tuple(A_			)







from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__snake_case   							=						{
    '''configuration_autoformer''': [
        '''AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''AutoformerConfig''',
    ],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __snake_case   							=						[
        '''AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
        '''AutoformerForPrediction''',
        '''AutoformerModel''',
        '''AutoformerPreTrainedModel''',
    ]


if TYPE_CHECKING:
    from .configuration_autoformer import (
        AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
        AutoformerConfig,
    )

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_autoformer import (
            AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
            AutoformerForPrediction,
            AutoformerModel,
            AutoformerPreTrainedModel,
        )

else:
    import sys

    __snake_case   							=						_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)


