






"""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 						__lowerCamelCase      (    __UpperCamelCase			)		->       Optional[Any]:

		"""simple docstring"""







		return EnvironmentCommand()



class 						__lowerCamelCase							(					lowerCAmelCase_     ):





		'''simple docstring'''






		@staticmethod
		def   lowerCamelCase			(  a_				:      ArgumentParser      ):
				lowerCAmelCase_  :				Any   							=     parser.add_parser("env"      )
				download_parser.set_defaults(func=__lowerCamelCase      )





		def   lowerCamelCase			(  self				:      str      ):
				lowerCAmelCase_  :				str   							=     huggingface_hub.__version__

				lowerCAmelCase_  :				Any   							=     'not installed'
				lowerCAmelCase_  :				Any   							=     'NA'
				if is_torch_available():
						import torch

						lowerCAmelCase_  :				Union[str, Any]   							=     torch.__version__
						lowerCAmelCase_  :				List[str]   							=     torch.cuda.is_available()

				lowerCAmelCase_  :				Union[str, Any]   							=     'not installed'
				if is_transformers_available():
						import transformers

						lowerCAmelCase_  :				Any   							=     transformers.__version__

				lowerCAmelCase_  :				Union[str, Any]   							=     'not installed'
				if is_accelerate_available():
						import accelerate

						lowerCAmelCase_  :				int   							=     accelerate.__version__

				lowerCAmelCase_  :				Tuple   							=     'not installed'
				if is_xformers_available():
						import xformers

						lowerCAmelCase_  :				List[str]   							=     xformers.__version__

				lowerCAmelCase_  :				Tuple   							=     {
				    '`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(__lowerCamelCase      )      )

				return info





		@staticmethod
		def   lowerCamelCase			(  a_				:      Union[str, Any]      ):
				return "\n".join([f'''- {prop}: {val}''' for prop, val in d.items()]      ) + "\n"






'''simple docstring'''






# flake8: noqa
# Lint as: python3
A_			      =		[
    "VerificationMode",
    "Version",
    "disable_progress_bar",
    "enable_progress_bar",
    "is_progress_bar_enabled",
    "experimental",
]

from .info_utils import VerificationMode
from .logging import disable_progress_bar, enable_progress_bar, is_progress_bar_enabled
from .version import Version
from .experimental import experimental
