




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


_lowerCamelCase     :		List[Any]								=       logging.get_logger(__name__)

_lowerCamelCase     :		List[str]								=       {"""vocab_file""": """vocab.txt"""}

_lowerCamelCase     :		List[Any]								=       {
    """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""",
    }
}

_lowerCamelCase     :		Dict								=       {
    """YituTech/conv-bert-base""": 512,
    """YituTech/conv-bert-medium-small""": 512,
    """YituTech/conv-bert-small""": 512,
}


_lowerCamelCase     :		Optional[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     UpperCamelCase_   (			UpperCAmelCase__					):

    '''simple docstring'''






    UpperCAmelCase__							  =				VOCAB_FILES_NAMES
    UpperCAmelCase__							  =				PRETRAINED_VOCAB_FILES_MAP
    UpperCAmelCase__							  =				PRETRAINED_INIT_CONFIGURATION
    UpperCAmelCase__							  =				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
    UpperCAmelCase__							  =				ConvBertTokenizer


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





           '''simple docstring'''

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

           A__							=   json.loads(self.backend_tokenizer.normalizer.__getstate__())
           if (
               normalizer_state.get('''lowercase''' ,			_lowerCAmelCase) != do_lower_case
               or normalizer_state.get('''strip_accents''' ,			_lowerCAmelCase) != strip_accents
               or normalizer_state.get('''handle_chinese_chars''' ,			_lowerCAmelCase) != tokenize_chinese_chars
           ):
                  A__							=   getattr(_lowerCAmelCase ,			normalizer_state.pop('''type'''))
                  A__							=   do_lower_case
                  A__							=   strip_accents
                  A__							=   tokenize_chinese_chars
                  A__							=   normalizer_class(**_lowerCAmelCase)

           A__							=   do_lower_case


    def 	SCREAMING_SNAKE_CASE							(      self				:     Dict ,			UpperCAmelCase__				:     Dict ,			UpperCAmelCase__				:     Tuple=None)						->Optional[int]:





           '''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 	SCREAMING_SNAKE_CASE							(      self				:     Optional[Any] ,			UpperCAmelCase__				:     List[int] ,			UpperCAmelCase__				:     Optional[List[int]] = None)						->Union[str, Any]:





           '''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 	SCREAMING_SNAKE_CASE							(      self				:     Union[str, Any] ,			UpperCAmelCase__				:     str ,			UpperCAmelCase__				:     Optional[str] = None)						->List[str]:





           '''simple docstring'''

           A__							=   self._tokenizer.model.save(_lowerCAmelCase ,			name=_lowerCAmelCase)
           return tuple(_lowerCAmelCase)








from typing import TYPE_CHECKING

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


_lowerCamelCase     :		Union[str, Any]								=       {
    """configuration_swiftformer""": [
        """SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """SwiftFormerConfig""",
        """SwiftFormerOnnxConfig""",
    ]
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCamelCase     :		Union[str, 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

  _lowerCamelCase     :		str								=       _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


