"""simple docstring"""






from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding





class 					_A		(			lowerCAmelCase      ):
      snake_case__     :  List[Any]				    =      ['image_processor', 'tokenizer']
      snake_case__     :  Optional[Any]				    =      'AutoImageProcessor'
      snake_case__     :  Dict				    =      'AutoTokenizer'

      def __init__(		self						,			__lowerCAmelCase						,			__lowerCAmelCase		):







            """simple docstring"""



            super().__init__(__lowerCAmelCase						,			__lowerCAmelCase		)
            lowercase								=      self.image_processor

      def __call__(		self						,			__lowerCAmelCase=None						,			__lowerCAmelCase=None						,			__lowerCAmelCase=None						,			**__lowerCAmelCase		):







            """simple docstring"""



            if text is None and images is None:
                  raise ValueError("""You have to specify either text or images. Both cannot be none."""		)

            if text is not None:
                  lowercase								=      self.tokenizer(__lowerCAmelCase						,			return_tensors=__lowerCAmelCase						,			**__lowerCAmelCase		)

            if images is not None:
                  lowercase								=      self.image_processor(__lowerCAmelCase						,			return_tensors=__lowerCAmelCase						,			**__lowerCAmelCase		)

            if text is not None and images is not None:
                  lowercase								=      image_features.pixel_values
                  return encoding
            elif text is not None:
                  return encoding
            else:
                  return BatchEncoding(data=dict(**__lowerCAmelCase		)						,			tensor_type=__lowerCAmelCase		)

      def 							A__			(		self						,			*__lowerCAmelCase						,			**__lowerCAmelCase		):







            """simple docstring"""



            return self.tokenizer.batch_decode(*__lowerCAmelCase						,			**__lowerCAmelCase		)

      def 							A__			(		self						,			*__lowerCAmelCase						,			**__lowerCAmelCase		):







            """simple docstring"""



            return self.tokenizer.decode(*__lowerCAmelCase						,			**__lowerCAmelCase		)







      @property
      def 							A__			(		self		):







            """simple docstring"""



            return ["input_ids", "attention_mask", "pixel_values"]




"""simple docstring"""






from typing import TYPE_CHECKING

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


__lowerCAmelCase       :			Optional[int]   	={
    """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       :			List[Any]   	=["""ChineseCLIPFeatureExtractor"""]
       __lowerCAmelCase       :			List[Any]   	=["""ChineseCLIPImageProcessor"""]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCAmelCase       :			Tuple   	=[
           """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       :			Optional[Any]   	=_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



