





'''simple docstring'''


import importlib
import os
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, Optional, Union

import torch

from ..utils import BaseOutput


lowerCAmelCase :					List[Any] 							='''scheduler_config.json'''
class 				a_       (    _lowerCAmelCase							):
     __A								=      1
     __A								=      2
     __A								=      3
     __A								=      4
     __A								=      5
     __A								=      6
     __A								=      7
     __A								=      8
     __A								=      9
     __A								=      10
     __A								=      11
     __A								=      12
     __A								=      13
     __A								=      14







@dataclass
class 				a_       (    _lowerCAmelCase							):
     __A								=      42







class 				a_       :
     __A								=      SCHEDULER_CONFIG_NAME
     __A								=      []
     __A								=      True





     @classmethod
     def 							lowercase__				(			cls		: Any     ,				lowercase		: Dict[str, Any] = None     ,				lowercase		: Optional[str] = None     ,				lowercase		: Optional[int]=False     ,				**lowercase		: Union[str, Any]     ,				):





        """simple docstring"""




        lowercase_      ,							lowercase_      ,							lowercase_      :List[str]         =			cls.load_config(
            pretrained_model_name_or_path=lowercase     ,				subfolder=lowercase     ,				return_unused_kwargs=lowercase     ,				return_commit_hash=lowercase     ,				**lowercase     ,				)
        return cls.from_config(lowercase     ,				return_unused_kwargs=lowercase     ,				**lowercase						)





     def 							lowercase__				(			self		: Optional[int]     ,				lowercase		: Union[str, os.PathLike]     ,				lowercase		: bool = False     ,				**lowercase		: List[str]						):





        """simple docstring"""




        self.save_config(save_directory=lowercase     ,				push_to_hub=lowercase     ,				**lowercase						)





     @property
     def 							lowercase__				(			self		: int						):





        """simple docstring"""




        return self._get_compatibles()







     @classmethod
     def 							lowercase__				(			cls		: Union[str, Any]						):





        """simple docstring"""




        lowercase_      :Union[str, Any]         =			list(set([cls.__name__] + cls._compatibles						)						)
        lowercase_      :int         =			importlib.import_module(__name__.split("."						)[0]						)
        lowercase_      :List[str]         =			[
            getattr(lowercase     ,				lowercase						) for c in compatible_classes_str if hasattr(lowercase     ,				lowercase						)
        ]
        return compatible_classes









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


lowerCAmelCase :					int 							={
    '''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:
 lowerCAmelCase :					Any 							=['''CLIPTokenizerFast''']

try:
 if not is_vision_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCAmelCase :					str 							=['''CLIPFeatureExtractor''']
 lowerCAmelCase :					Optional[int] 							=['''CLIPImageProcessor''']

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

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCAmelCase :					Union[str, Any] 							=[
     '''TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''TFCLIPModel''',
     '''TFCLIPPreTrainedModel''',
     '''TFCLIPTextModel''',
     '''TFCLIPVisionModel''',
 ]

try:
 if not is_flax_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCAmelCase :					List[Any] 							=[
     '''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

 lowerCAmelCase :					int 							=_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)


