import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_mobilebert import MobileBertTokenizer


__UpperCamelCase		:       Dict									=     logging.get_logger(__name__)

__UpperCamelCase		:       List[Any]									=     {'vocab_file': 'vocab.txt', 'tokenizer_file': 'tokenizer.json'}

__UpperCamelCase		:       Optional[Any]									=     {
    'vocab_file': {'mobilebert-uncased': 'https://huggingface.co/google/mobilebert-uncased/resolve/main/vocab.txt'},
    'tokenizer_file': {
        'mobilebert-uncased': 'https://huggingface.co/google/mobilebert-uncased/resolve/main/tokenizer.json'
    },
}

__UpperCamelCase		:       Any									=     {'mobilebert-uncased': 512}


__UpperCamelCase		:       str									=     {}





class 					lowercase__						(   UpperCamelCase_):
						UpperCamelCase_     =		VOCAB_FILES_NAMES
						UpperCamelCase_     =		PRETRAINED_VOCAB_FILES_MAP
						UpperCamelCase_     =		PRETRAINED_INIT_CONFIGURATION
						UpperCamelCase_     =		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
						UpperCamelCase_     =		MobileBertTokenizer


						def __init__(       self	:				List[str]    ,		UpperCamelCase__	:				Optional[int]=None    ,		UpperCamelCase__	:				List[str]=None    ,		UpperCamelCase__	:				Dict=True    ,		UpperCamelCase__	:				Any="[UNK]"    ,		UpperCamelCase__	:				Optional[Any]="[SEP]"    ,		UpperCamelCase__	:				Union[str, Any]="[PAD]"    ,		UpperCamelCase__	:				Dict="[CLS]"    ,		UpperCamelCase__	:				Optional[int]="[MASK]"    ,		UpperCamelCase__	:				int=True    ,		UpperCamelCase__	:				str=None    ,		**UpperCamelCase__	:				Any    ,		):





												'''simple docstring'''





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

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

												SCREAMING_SNAKE_CASE							:    Any							=							do_lower_case


						def        __A       (       self	:				List[str]    ,		UpperCamelCase__	:				Optional[int]    ,		UpperCamelCase__	:				int=None						):





												'''simple docstring'''





												SCREAMING_SNAKE_CASE							:    int							=							[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        __A       (       self	:				str    ,		UpperCamelCase__	:				List[int]    ,		UpperCamelCase__	:				Optional[List[int]] = None						):





												'''simple docstring'''





												SCREAMING_SNAKE_CASE							:    Optional[Any]							=							[self.sep_token_id]
												SCREAMING_SNAKE_CASE							:    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        __A       (       self	:				Union[str, Any]    ,		UpperCamelCase__	:				str    ,		UpperCamelCase__	:				Optional[str] = None						):





												'''simple docstring'''





												SCREAMING_SNAKE_CASE							:    Dict							=							self._tokenizer.model.save(UpperCamelCase__    ,		name=UpperCamelCase__						)
												return tuple(UpperCamelCase__						)






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


__UpperCamelCase		:       Tuple									=     {
    'configuration_swiftformer': [
        'SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'SwiftFormerConfig',
        'SwiftFormerOnnxConfig',
    ]
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__UpperCamelCase		:       Optional[Any]									=     [
					    'SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
					    'SwiftFormerForImageClassification',
					    'SwiftFormerModel',
					    'SwiftFormerPreTrainedModel',
					]

if TYPE_CHECKING:
					from .configuration_swiftformer import (
					    SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    SwiftFormerConfig,
					    SwiftFormerOnnxConfig,
					)

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_swiftformer import (
										    SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    SwiftFormerForImageClassification,
										    SwiftFormerModel,
										    SwiftFormerPreTrainedModel,
										)

else:
					import sys

					__UpperCamelCase		:       List[Any]									=     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





