


'''simple docstring'''

import platform
from argparse import ArgumentParser

import huggingface_hub

from .. import __version__ as version
from ..utils import is_accelerate_available, is_torch_available, is_transformers_available, is_xformers_available
from . import BaseDiffusersCLICommand





def __snake_case      (   UpperCAmelCase_		:		Union[str, Any]	):
 return EnvironmentCommand()







class   snake_case					(					lowercase    ):





  """simple docstring"""




  @staticmethod
  def 						snake_case	(					UpperCamelCase  ):







   """simple docstring"""
   lowerCamelCase_  				=						parser.add_parser("env"  )
   download_parser.set_defaults(func=UpperCamelCase  )






  def 						snake_case	(					self  ):







   """simple docstring"""
   lowerCamelCase_  				=						huggingface_hub.__version__

   lowerCamelCase_  				=						"not installed"
   lowerCamelCase_  				=						"NA"
   if is_torch_available():
    import torch

    lowerCamelCase_  				=						torch.__version__
    lowerCamelCase_  				=						torch.cuda.is_available()

   lowerCamelCase_  				=						"not installed"
   if is_transformers_available():
    import transformers

    lowerCamelCase_  				=						transformers.__version__

   lowerCamelCase_  				=						"not installed"
   if is_accelerate_available():
    import accelerate

    lowerCamelCase_  				=						accelerate.__version__

   lowerCamelCase_  				=						"not installed"
   if is_xformers_available():
    import xformers

    lowerCamelCase_  				=						xformers.__version__

   lowerCamelCase_  				=						{
       "`diffusers` version": version,
       "Platform": platform.platform(),
       "Python version": platform.python_version(),
       "PyTorch version (GPU?)": f'''{pt_version} ({pt_cuda_available})''',
       "Huggingface_hub version": hub_version,
       "Transformers version": transformers_version,
       "Accelerate version": accelerate_version,
       "xFormers version": xformers_version,
       "Using GPU in script?": "<fill in>",
       "Using distributed or parallel set-up in script?": "<fill in>",
   }

   print("\nCopy-and-paste the text below in your GitHub issue and FILL OUT the two last points.\n"  )
   print(self.format_dict(UpperCamelCase  )  )

   return info







  @staticmethod
  def 						snake_case	(					UpperCamelCase  ):







   """simple docstring"""
   return "\n".join([f'''- {prop}: {val}''' for prop, val in d.items()]  ) + "\n"







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


a_						:       List[Any]      			=				{
    """configuration_owlvit""": [
        """OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """OwlViTConfig""",
        """OwlViTOnnxConfig""",
        """OwlViTTextConfig""",
        """OwlViTVisionConfig""",
    ],
    """processing_owlvit""": ["""OwlViTProcessor"""],
}


try:
     if not is_vision_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     a_						:       int      			=				["""OwlViTFeatureExtractor"""]
     a_						:       Any      			=				["""OwlViTImageProcessor"""]

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     a_						:       Tuple      			=				[
         """OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
         """OwlViTModel""",
         """OwlViTPreTrainedModel""",
         """OwlViTTextModel""",
         """OwlViTVisionModel""",
         """OwlViTForObjectDetection""",
     ]

if TYPE_CHECKING:
     from .configuration_owlvit import (
         OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP,
         OwlViTConfig,
         OwlViTOnnxConfig,
         OwlViTTextConfig,
         OwlViTVisionConfig,
     )
     from .processing_owlvit import OwlViTProcessor

     try:
          if not is_vision_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .feature_extraction_owlvit import OwlViTFeatureExtractor
          from .image_processing_owlvit import OwlViTImageProcessor

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_owlvit import (
              OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
              OwlViTForObjectDetection,
              OwlViTModel,
              OwlViTPreTrainedModel,
              OwlViTTextModel,
              OwlViTVisionModel,
          )

else:
     import sys

     a_						:       Tuple      			=				_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



