

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


_snake_case         =  logging.get_logger(__name__)

_snake_case         =  {'vocab_file': 'vocab.txt', 'tokenizer_file': 'tokenizer.json'}

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

_snake_case         =  {'mobilebert-uncased': 512}


_snake_case         =  {}


class        a__  (							lowerCamelCase_  ):
   _SCREAMING_SNAKE_CASE   :					List[str]     	=							VOCAB_FILES_NAMES
   _SCREAMING_SNAKE_CASE   :					List[Any]     	=							PRETRAINED_VOCAB_FILES_MAP
   _SCREAMING_SNAKE_CASE   :					Any     	=							PRETRAINED_INIT_CONFIGURATION
   _SCREAMING_SNAKE_CASE   :					List[str]     	=							PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
   _SCREAMING_SNAKE_CASE   :					List[str]     	=							MobileBertTokenizer


   def __init__(			self      ,    _UpperCamelCase=None      ,    _UpperCamelCase=None      ,    _UpperCamelCase=True      ,    _UpperCamelCase="[UNK]"      ,    _UpperCamelCase="[SEP]"      ,    _UpperCamelCase="[PAD]"      ,    _UpperCamelCase="[CLS]"      ,    _UpperCamelCase="[MASK]"      ,    _UpperCamelCase=True      ,    _UpperCamelCase=None      ,    **_UpperCamelCase      ,    ):





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

      _lowercase      :				List[str]      					=       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
      ):
         _lowercase      :				int      					=       getattr(_UpperCamelCase      ,    normalizer_state.pop("type"  )  )
         _lowercase      :				Union[str, Any]      					=       do_lower_case
         _lowercase      :				Optional[int]      					=       strip_accents
         _lowercase      :				Dict      					=       tokenize_chinese_chars
         _lowercase      :				List[str]      					=       normalizer_class(**_UpperCamelCase  )

      _lowercase      :				Dict      					=       do_lower_case


   def 						_lowerCamelCase       (			self      ,    _UpperCamelCase      ,    _UpperCamelCase=None  ):





      """simple docstring"""





      _lowercase      :				List[str]      					=       [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 						_lowerCamelCase       (			self      ,    _UpperCamelCase      ,    _UpperCamelCase = None  ):





      """simple docstring"""





      _lowercase      :				Any      					=       [self.sep_token_id]
      _lowercase      :				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 						_lowerCamelCase       (			self      ,    _UpperCamelCase      ,    _UpperCamelCase = None  ):





      """simple docstring"""





      _lowercase      :				Dict      					=       self._tokenizer.model.save(_UpperCamelCase      ,    name=_UpperCamelCase  )
      return tuple(_UpperCamelCase  )









'''simple docstring'''
import warnings

from ...utils import logging
from .image_processing_chinese_clip import ChineseCLIPImageProcessor


_snake_case         =  logging.get_logger(__name__)


class        a__  (							lowerCamelCase_  ):


   def __init__(			self      ,    *_UpperCamelCase      ,    **_UpperCamelCase  ):





      """simple docstring"""





      warnings.warn(
          "The class ChineseCLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers."
          " Please use ChineseCLIPImageProcessor instead."      ,    _UpperCamelCase      ,    )
      super().__init__(*_UpperCamelCase      ,    **_UpperCamelCase  )






