





import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_squeezebert import SqueezeBertTokenizer


__lowerCamelCase			:	Dict					    =	logging.get_logger(__name__)

__lowerCamelCase			:	List[str]					    =	{"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

__lowerCamelCase			:	Any					    =	{
    """vocab_file""": {
        """squeezebert/squeezebert-uncased""": (
            """https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/vocab.txt"""
        ),
        """squeezebert/squeezebert-mnli""": """https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/vocab.txt""",
        """squeezebert/squeezebert-mnli-headless""": (
            """https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/vocab.txt"""
        ),
    },
    """tokenizer_file""": {
        """squeezebert/squeezebert-uncased""": (
            """https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/tokenizer.json"""
        ),
        """squeezebert/squeezebert-mnli""": (
            """https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/tokenizer.json"""
        ),
        """squeezebert/squeezebert-mnli-headless""": (
            """https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/tokenizer.json"""
        ),
    },
}

__lowerCamelCase			:	Optional[int]					    =	{
    """squeezebert/squeezebert-uncased""": 512,
    """squeezebert/squeezebert-mnli""": 512,
    """squeezebert/squeezebert-mnli-headless""": 512,
}


__lowerCamelCase			:	str					    =	{
    """squeezebert/squeezebert-uncased""": {"""do_lower_case""": True},
    """squeezebert/squeezebert-mnli""": {"""do_lower_case""": True},
    """squeezebert/squeezebert-mnli-headless""": {"""do_lower_case""": True},
}



class    A__  (			__snake_case     ):
      _UpperCAmelCase      :int		       =  VOCAB_FILES_NAMES
      _UpperCAmelCase      :Tuple		       =  PRETRAINED_VOCAB_FILES_MAP
      _UpperCAmelCase      :Tuple		       =  PRETRAINED_INIT_CONFIGURATION
      _UpperCAmelCase      :int		       =  PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      _UpperCAmelCase      :str		       =  SqueezeBertTokenizer





      def __init__(					self			,				A_=None			,				A_=None			,				A_=True			,				A_="[UNK]"			,				A_="[SEP]"			,				A_="[PAD]"			,				A_="[CLS]"			,				A_="[MASK]"			,				A_=True			,				A_=None			,				**A_			,				):
       '''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_			,				)

       UpperCamelCase      :   List[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
       ):
        UpperCamelCase      :   int			      =  getattr(A_			,				normalizer_state.pop("type"  )  )
        UpperCamelCase      :   Optional[int]			      =  do_lower_case
        UpperCamelCase      :   Tuple			      =  strip_accents
        UpperCamelCase      :   Any			      =  tokenize_chinese_chars
        UpperCamelCase      :   List[Any]			      =  normalizer_class(**A_  )

       UpperCamelCase      :   Optional[int]			      =  do_lower_case





      def 			__UpperCamelCase(					self			,				A_			,				A_=None  ):
       '''simple docstring'''




       UpperCamelCase      :   Union[str, 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 			__UpperCamelCase(					self			,				A_			,				A_ = None  ):
       '''simple docstring'''




       UpperCamelCase      :   Optional[Any]			      =  [self.sep_token_id]
       UpperCamelCase      :   Tuple			      =  [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 			__UpperCamelCase(					self			,				A_			,				A_ = None  ):
       '''simple docstring'''




       UpperCamelCase      :   int			      =  self._tokenizer.model.save(A_			,				name=A_  )
       return tuple(A_  )







from typing import TYPE_CHECKING

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


__lowerCamelCase			:	List[Any]					    =	{
    """configuration_chinese_clip""": [
        """CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """ChineseCLIPConfig""",
        """ChineseCLIPOnnxConfig""",
        """ChineseCLIPTextConfig""",
        """ChineseCLIPVisionConfig""",
    ],
    """processing_chinese_clip""": ["""ChineseCLIPProcessor"""],
}

try:
    if not is_vision_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowerCamelCase			:	Tuple					    =	["""ChineseCLIPFeatureExtractor"""]
    __lowerCamelCase			:	List[str]					    =	["""ChineseCLIPImageProcessor"""]

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowerCamelCase			:	str					    =	[
        """CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST""",
        """ChineseCLIPModel""",
        """ChineseCLIPPreTrainedModel""",
        """ChineseCLIPTextModel""",
        """ChineseCLIPVisionModel""",
    ]

if TYPE_CHECKING:
    from .configuration_chinese_clip import (
        CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
        ChineseCLIPConfig,
        ChineseCLIPOnnxConfig,
        ChineseCLIPTextConfig,
        ChineseCLIPVisionConfig,
    )
    from .processing_chinese_clip import ChineseCLIPProcessor

    try:
        if not is_vision_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .feature_extraction_chinese_clip import ChineseCLIPFeatureExtractor, ChineseCLIPImageProcessor

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_chinese_clip import (
            CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
            ChineseCLIPModel,
            ChineseCLIPPreTrainedModel,
            ChineseCLIPTextModel,
            ChineseCLIPVisionModel,
        )

else:
    import sys

    __lowerCamelCase			:	Any					    =	_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
