






'''simple docstring'''

from argparse import ArgumentParser

from .env import EnvironmentCommand






def 	_UpperCAmelCase    (  )			->			int:





						"""simple docstring"""
						lowercase_      :   Optional[Any]        =			ArgumentParser('Diffusers CLI tool'						,			usage='diffusers-cli <command> [<args>]'							)
						lowercase_      :   Union[str, Any]        =			parser.add_subparsers(help='diffusers-cli command helpers'							)

						# Register commands
						EnvironmentCommand.register_subcommand(lowerCAmelCase__							)

						# Let's go
						lowercase_      :   Optional[Any]        =			parser.parse_args()

						if not hasattr(lowerCAmelCase__						,			'func'							):
												parser.print_help()
												exit(1							)

						# Run
						lowercase_      :   Any        =			args.func(lowerCAmelCase__							)
						service.run()


if __name__ == "__main__":
						main()








'''simple docstring'''

import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible






class 							__magic_name__     (	unittest.TestCase				):







	"""simple docstring"""



	def        lowerCamelCase__		(							self       )						->  Optional[Any]:
							lowercase_      :   Tuple        =			[
							    'safety_checker/pytorch_model.bin',
							    'safety_checker/model.safetensors',
							    'vae/diffusion_pytorch_model.bin',
							    'vae/diffusion_pytorch_model.safetensors',
							    'text_encoder/pytorch_model.bin',
							    'text_encoder/model.safetensors',
							    'unet/diffusion_pytorch_model.bin',
							    'unet/diffusion_pytorch_model.safetensors',
							]
							self.assertTrue(is_safetensors_compatible(_lowercase       )       )
	def        lowerCamelCase__		(							self       )						->  Dict:
							lowercase_      :   Tuple        =			[
							    'unet/diffusion_pytorch_model.bin',
							    'unet/diffusion_pytorch_model.safetensors',
							]
							self.assertTrue(is_safetensors_compatible(_lowercase       )       )
	def        lowerCamelCase__		(							self       )						->  str:
							lowercase_      :   int        =			[
							    'safety_checker/pytorch_model.bin',
							    'safety_checker/model.safetensors',
							    'vae/diffusion_pytorch_model.bin',
							    'vae/diffusion_pytorch_model.safetensors',
							    'text_encoder/pytorch_model.bin',
							    'text_encoder/model.safetensors',
							    'unet/diffusion_pytorch_model.bin',
							    # Removed: 'unet/diffusion_pytorch_model.safetensors',
							]
							self.assertFalse(is_safetensors_compatible(_lowercase       )       )
	def        lowerCamelCase__		(							self       )						->  Any:
							lowercase_      :   Dict        =			[
							    'text_encoder/pytorch_model.bin',
							    'text_encoder/model.safetensors',
							]
							self.assertTrue(is_safetensors_compatible(_lowercase       )       )
	def        lowerCamelCase__		(							self       )						->  Optional[Any]:
							lowercase_      :   List[Any]        =			[
							    'safety_checker/pytorch_model.bin',
							    'safety_checker/model.safetensors',
							    'vae/diffusion_pytorch_model.bin',
							    'vae/diffusion_pytorch_model.safetensors',
							    'text_encoder/pytorch_model.bin',
							    # Removed: 'text_encoder/model.safetensors',
							    'unet/diffusion_pytorch_model.bin',
							    'unet/diffusion_pytorch_model.safetensors',
							]
							self.assertFalse(is_safetensors_compatible(_lowercase       )       )
	def        lowerCamelCase__		(							self       )						->  Optional[int]:
							lowercase_      :   str        =			[
							    'safety_checker/pytorch_model.fp16.bin',
							    'safety_checker/model.fp16.safetensors',
							    'vae/diffusion_pytorch_model.fp16.bin',
							    'vae/diffusion_pytorch_model.fp16.safetensors',
							    'text_encoder/pytorch_model.fp16.bin',
							    'text_encoder/model.fp16.safetensors',
							    'unet/diffusion_pytorch_model.fp16.bin',
							    'unet/diffusion_pytorch_model.fp16.safetensors',
							]
							lowercase_      :   Union[str, Any]        =			'fp16'
							self.assertTrue(is_safetensors_compatible(_lowercase  ,      variant=_lowercase       )       )
	def        lowerCamelCase__		(							self       )						->  int:
							lowercase_      :   Optional[int]        =			[
							    'unet/diffusion_pytorch_model.fp16.bin',
							    'unet/diffusion_pytorch_model.fp16.safetensors',
							]
							lowercase_      :   Dict        =			'fp16'
							self.assertTrue(is_safetensors_compatible(_lowercase  ,      variant=_lowercase       )       )
	def        lowerCamelCase__		(							self       )						->  int:
							# pass variant but use the non-variant filenames
							lowercase_      :   Optional[int]        =			[
							    'unet/diffusion_pytorch_model.bin',
							    'unet/diffusion_pytorch_model.safetensors',
							]
							lowercase_      :   Dict        =			'fp16'
							self.assertTrue(is_safetensors_compatible(_lowercase  ,      variant=_lowercase       )       )
	def        lowerCamelCase__		(							self       )						->  Union[str, Any]:
							lowercase_      :   int        =			[
							    'safety_checker/pytorch_model.fp16.bin',
							    'safety_checker/model.fp16.safetensors',
							    'vae/diffusion_pytorch_model.fp16.bin',
							    'vae/diffusion_pytorch_model.fp16.safetensors',
							    'text_encoder/pytorch_model.fp16.bin',
							    'text_encoder/model.fp16.safetensors',
							    'unet/diffusion_pytorch_model.fp16.bin',
							    # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
							]
							lowercase_      :   Dict        =			'fp16'
							self.assertFalse(is_safetensors_compatible(_lowercase  ,      variant=_lowercase       )       )
	def        lowerCamelCase__		(							self       )						->  int:
							lowercase_      :   str        =			[
							    'text_encoder/pytorch_model.fp16.bin',
							    'text_encoder/model.fp16.safetensors',
							]
							lowercase_      :   str        =			'fp16'
							self.assertTrue(is_safetensors_compatible(_lowercase  ,      variant=_lowercase       )       )
	def        lowerCamelCase__		(							self       )						->  List[str]:
							# pass variant but use the non-variant filenames
							lowercase_      :   List[Any]        =			[
							    'text_encoder/pytorch_model.bin',
							    'text_encoder/model.safetensors',
							]
							lowercase_      :   Dict        =			'fp16'
							self.assertTrue(is_safetensors_compatible(_lowercase  ,      variant=_lowercase       )       )







	def        lowerCamelCase__		(							self       )						->  List[str]:
							lowercase_      :   Union[str, Any]        =			[
							    'safety_checker/pytorch_model.fp16.bin',
							    'safety_checker/model.fp16.safetensors',
							    'vae/diffusion_pytorch_model.fp16.bin',
							    'vae/diffusion_pytorch_model.fp16.safetensors',
							    'text_encoder/pytorch_model.fp16.bin',
							    # 'text_encoder/model.fp16.safetensors',
							    'unet/diffusion_pytorch_model.fp16.bin',
							    'unet/diffusion_pytorch_model.fp16.safetensors',
							]
							lowercase_      :   Dict        =			'fp16'
							self.assertFalse(is_safetensors_compatible(_lowercase  ,      variant=_lowercase       )       )
