






'''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


lowerCamelCase_												=					logging.get_logger(__name__)

lowerCamelCase_												=					{'''vocab_file''': '''vocab.txt'''}

lowerCamelCase_												=					{
    '''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_												=					{
    '''YituTech/conv-bert-base''': 5_12,
    '''YituTech/conv-bert-medium-small''': 5_12,
    '''YituTech/conv-bert-small''': 5_12,
}


lowerCamelCase_												=					{
    '''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			(     snake_case_						):




   """simple docstring"""

   snake_case    				=						VOCAB_FILES_NAMES
   snake_case    				=						PRETRAINED_VOCAB_FILES_MAP
   snake_case    				=						PRETRAINED_INIT_CONFIGURATION
   snake_case    				=						PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
   snake_case    				=						ConvBertTokenizer

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





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

         _A			     =	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
         ):
               _A			     =	getattr(__UpperCAmelCase      ,      normalizer_state.pop("type"		)		)
               _A			     =	do_lower_case
               _A			     =	strip_accents
               _A			     =	tokenize_chinese_chars
               _A			     =	normalizer_class(**__UpperCAmelCase		)

         _A			     =	do_lower_case

   def 						lowerCAmelCase (		self :	Union[str, Any]      ,      __UpperCAmelCase :	List[str]      ,      __UpperCAmelCase :	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 						lowerCAmelCase (		self :	int      ,      __UpperCAmelCase :	List[int]      ,      __UpperCAmelCase :	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 						lowerCAmelCase (		self :	Optional[int]      ,      __UpperCAmelCase :	str      ,      __UpperCAmelCase :	Optional[str] = None		):





         '''simple docstring'''





         _A			     =	self._tokenizer.model.save(__UpperCAmelCase      ,      name=__UpperCAmelCase		)
         return tuple(__UpperCAmelCase		)










"""simple docstring"""
from typing import TYPE_CHECKING

from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available, is_vision_available
from ...utils import OptionalDependencyNotAvailable


A:   List[str]								=		{"configuration_dpt": ["DPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DPTConfig"]}

try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   Tuple								=		["DPTFeatureExtractor"]
      A:   int								=		["DPTImageProcessor"]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   Optional[Any]								=		[
          "DPT_PRETRAINED_MODEL_ARCHIVE_LIST",
          "DPTForDepthEstimation",
          "DPTForSemanticSegmentation",
          "DPTModel",
          "DPTPreTrainedModel",
      ]


if TYPE_CHECKING:
      from .configuration_dpt import DPT_PRETRAINED_CONFIG_ARCHIVE_MAP, DPTConfig

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .feature_extraction_dpt import DPTFeatureExtractor
            from .image_processing_dpt import DPTImageProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_dpt import (
                DPT_PRETRAINED_MODEL_ARCHIVE_LIST,
                DPTForDepthEstimation,
                DPTForSemanticSegmentation,
                DPTModel,
                DPTPreTrainedModel,
            )


else:
      import sys

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