




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


_snake_case            = logging.get_logger(__name__)

_snake_case            = {"vocab_file": "vocab.txt"}

_snake_case            = {
    "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",
    }
}

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


_snake_case            = {
    "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 		lowercase							(     UpperCamelCase__	):
     _a											=		VOCAB_FILES_NAMES
     _a											=		PRETRAINED_VOCAB_FILES_MAP
     _a											=		PRETRAINED_INIT_CONFIGURATION
     _a											=		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
     _a											=		ConvBertTokenizer

     def __init__(						self	,  _a=None	,  _a=None	,  _a=True	,  _a="[UNK]"	,  _a="[SEP]"	,  _a="[PAD]"	,  _a="[CLS]"	,  _a="[MASK]"	,  _a=True	,  _a=None	,  **_a	,  )		->							Any:
           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							:  Union[str, 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
           ):
                 _A							:  str    =		getattr(_a	,  normalizer_state.pop("""type"""       )       )
                 _A							:  Optional[Any]    =		do_lower_case
                 _A							:  List[str]    =		strip_accents
                 _A							:  Any    =		tokenize_chinese_chars
                 _A							:  Any    =		normalizer_class(**_a       )

           _A							:  Union[str, Any]    =		do_lower_case

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







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_snake_case            = {
    "configuration_time_series_transformer": [
        "TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "TimeSeriesTransformerConfig",
    ],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case            = [
      "TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
      "TimeSeriesTransformerForPrediction",
      "TimeSeriesTransformerModel",
      "TimeSeriesTransformerPreTrainedModel",
  ]


if TYPE_CHECKING:
  from .configuration_time_series_transformer import (
      TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
      TimeSeriesTransformerConfig,
  )

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_time_series_transformer import (
        TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        TimeSeriesTransformerForPrediction,
        TimeSeriesTransformerModel,
        TimeSeriesTransformerPreTrainedModel,
    )

else:
  import sys

  _snake_case            = _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

