


"""simple docstring"""

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


UpperCAmelCase__  							={
    "configuration_clip": [
        "CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "CLIPConfig",
        "CLIPOnnxConfig",
        "CLIPTextConfig",
        "CLIPVisionConfig",
    ],
    "processing_clip": ["CLIPProcessor"],
    "tokenization_clip": ["CLIPTokenizer"],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase__  							=["CLIPTokenizerFast"]

try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase__  							=["CLIPFeatureExtractor"]
   UpperCAmelCase__  							=["CLIPImageProcessor"]

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase__  							=[
       "CLIP_PRETRAINED_MODEL_ARCHIVE_LIST",
       "CLIPModel",
       "CLIPPreTrainedModel",
       "CLIPTextModel",
       "CLIPTextModelWithProjection",
       "CLIPVisionModel",
       "CLIPVisionModelWithProjection",
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase__  							=[
       "TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST",
       "TFCLIPModel",
       "TFCLIPPreTrainedModel",
       "TFCLIPTextModel",
       "TFCLIPVisionModel",
   ]

try:
   if not is_flax_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase__  							=[
       "FlaxCLIPModel",
       "FlaxCLIPPreTrainedModel",
       "FlaxCLIPTextModel",
       "FlaxCLIPTextPreTrainedModel",
       "FlaxCLIPVisionModel",
       "FlaxCLIPVisionPreTrainedModel",
   ]


if TYPE_CHECKING:
   from .configuration_clip import (
       CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
       CLIPConfig,
       CLIPOnnxConfig,
       CLIPTextConfig,
       CLIPVisionConfig,
   )
   from .processing_clip import CLIPProcessor
   from .tokenization_clip import CLIPTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_clip_fast import CLIPTokenizerFast

   try:
      if not is_vision_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .feature_extraction_clip import CLIPFeatureExtractor
      from .image_processing_clip import CLIPImageProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_clip import (
          CLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
          CLIPModel,
          CLIPPreTrainedModel,
          CLIPTextModel,
          CLIPTextModelWithProjection,
          CLIPVisionModel,
          CLIPVisionModelWithProjection,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_clip import (
          TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFCLIPModel,
          TFCLIPPreTrainedModel,
          TFCLIPTextModel,
          TFCLIPVisionModel,
      )

   try:
      if not is_flax_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_flax_clip import (
          FlaxCLIPModel,
          FlaxCLIPPreTrainedModel,
          FlaxCLIPTextModel,
          FlaxCLIPTextPreTrainedModel,
          FlaxCLIPVisionModel,
          FlaxCLIPVisionPreTrainedModel,
      )


else:
   import sys

   UpperCAmelCase__  							=_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




"""simple docstring"""

import inspect
import unittest





class    lowerCamelCase__						(		unittest.TestCase    ):
      def SCREAMING_SNAKE_CASE_	(		self	:	int							):






       '''simple docstring'''


       try:
        import diffusers  # noqa: F401
       except ImportError:
        assert False






      def SCREAMING_SNAKE_CASE_	(		self	:	Optional[Any]							):






       '''simple docstring'''


       import diffusers
       from diffusers.dependency_versions_table import deps

       __lowercase									=	inspect.getmembers(A_      ,       inspect.isclass							)

       for cls_name, cls_module in all_classes:
        if "dummy_" in cls_module.__module__:
         for backend in cls_module._backends:
          if backend == "k_diffusion":
           __lowercase									=	"""k-diffusion"""
          elif backend == "invisible_watermark":
           __lowercase									=	"""invisible-watermark"""
          assert backend in deps, F'''{backend} is not in the deps table!'''
