





from typing import List, Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_herbert import HerbertTokenizer


__lowerCamelCase			:	Dict					    =	logging.get_logger(__name__)

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

__lowerCamelCase			:	str					    =	{
    """vocab_file""": {
        """allegro/herbert-base-cased""": """https://huggingface.co/allegro/herbert-base-cased/resolve/main/vocab.json"""
    },
    """merges_file""": {
        """allegro/herbert-base-cased""": """https://huggingface.co/allegro/herbert-base-cased/resolve/main/merges.txt"""
    },
}

__lowerCamelCase			:	Tuple					    =	{"""allegro/herbert-base-cased""": 514}
__lowerCamelCase			:	List[str]					    =	{}



class    A__  (			__snake_case     ):
      _UpperCAmelCase      :Tuple		       =  VOCAB_FILES_NAMES
      _UpperCAmelCase      :Union[str, Any]		       =  PRETRAINED_VOCAB_FILES_MAP
      _UpperCAmelCase      :str		       =  PRETRAINED_INIT_CONFIGURATION
      _UpperCAmelCase      :Any		       =  PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      _UpperCAmelCase      :Union[str, Any]		       =  HerbertTokenizer





      def __init__(					self			,				A_=None			,				A_=None			,				A_=None			,				A_="<s>"			,				A_="<unk>"			,				A_="<pad>"			,				A_="<mask>"			,				A_="</s>"			,				**A_			,				):
       '''simple docstring'''




       super().__init__(
           A_			,				A_			,				tokenizer_file=A_			,				cls_token=A_			,				unk_token=A_			,				pad_token=A_			,				mask_token=A_			,				sep_token=A_			,				**A_			,				)





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




       UpperCamelCase      :   Union[str, Any]			      =  [self.cls_token_id]
       UpperCamelCase      :   Union[str, Any]			      =  [self.sep_token_id]
       if token_ids_a is None:
        return cls + token_ids_a + sep

       return cls + token_ids_a + sep + token_ids_a + sep





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




       if already_has_special_tokens:
        return super().get_special_tokens_mask(
            token_ids_a=A_			,				token_ids_a=A_			,				already_has_special_tokens=A_  )

       if token_ids_a is None:
        return [1] + ([0] * len(A_  )) + [1]
       return [1] + ([0] * len(A_  )) + [1] + ([0] * len(A_  )) + [1]





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




       UpperCamelCase      :   List[Any]			      =  [self.sep_token_id]
       UpperCamelCase      :   int			      =  [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      :   str			      =  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__)
