



"""simple docstring"""







import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_convbert import ConvBertTokenizer


__a       :	str             = logging.get_logger(__name__)

__a       :	Any             = {'vocab_file': 'vocab.txt'}

__a       :	int             = {
    'vocab_file': {
        'YituTech/conv-bert-base': 'https://huggingface.co/YituTech/conv-bert-base/resolve/main/vocab.txt',
        'YituTech/conv-bert-medium-small': (
            'https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/vocab.txt'
        ),
        'YituTech/conv-bert-small': 'https://huggingface.co/YituTech/conv-bert-small/resolve/main/vocab.txt',
    }
}

__a       :	List[str]             = {
    'YituTech/conv-bert-base': 512,
    'YituTech/conv-bert-medium-small': 512,
    'YituTech/conv-bert-small': 512,
}


__a       :	int             = {
    'YituTech/conv-bert-base': {'do_lower_case': True},
    'YituTech/conv-bert-medium-small': {'do_lower_case': True},
    'YituTech/conv-bert-small': {'do_lower_case': True},
}







class        _SCREAMING_SNAKE_CASE						(  __snake_case							):





							"""simple docstring"""





							_SCREAMING_SNAKE_CASE    =VOCAB_FILES_NAMES
							_SCREAMING_SNAKE_CASE    =PRETRAINED_VOCAB_FILES_MAP
							_SCREAMING_SNAKE_CASE    =PRETRAINED_INIT_CONFIGURATION
							_SCREAMING_SNAKE_CASE    =PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
							_SCREAMING_SNAKE_CASE    =ConvBertTokenizer




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

												'''simple docstring'''

												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				,		)

												a__          =  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
												):
																	a__          =  getattr(__A				,		normalizer_state.pop('''type'''    )    )
																	a__          =  do_lower_case
																	a__          =  strip_accents
																	a__          =  tokenize_chinese_chars
																	a__          =  normalizer_class(**__A    )

												a__          =  do_lower_case




							def  lowercase		(   self:     str				,		__A:     int				,		__A:     Union[str, Any]=None    ):

												'''simple docstring'''

												a__          =  [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:     Dict				,		__A:     List[int]				,		__A:     Optional[List[int]] = None    ):

												'''simple docstring'''

												a__          =  [self.sep_token_id]
												a__          =  [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:     str				,		__A:     str				,		__A:     Optional[str] = None    ):

												'''simple docstring'''

												a__          =  self._tokenizer.model.save(__A				,		name=__A    )
												return tuple(__A    )










"""simple docstring"""







from typing import TYPE_CHECKING

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


__a       :	str             = {
    'configuration_swiftformer': [
        'SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'SwiftFormerConfig',
        'SwiftFormerOnnxConfig',
    ]
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__a       :	int             = [
	    '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

	__a       :	Dict             = _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


