





import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible

class        __SCREAMING_SNAKE_CASE					(     unittest.TestCase       ):






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			[
														    """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(__lowerCAmelCase  )  )






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			[
														    """unet/diffusion_pytorch_model.bin""",
														    """unet/diffusion_pytorch_model.safetensors""",
														]
														self.assertTrue(is_safetensors_compatible(__lowerCAmelCase  )  )






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			[
														    """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(__lowerCAmelCase  )  )






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			[
														    """text_encoder/pytorch_model.bin""",
														    """text_encoder/model.safetensors""",
														]
														self.assertTrue(is_safetensors_compatible(__lowerCAmelCase  )  )






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			[
														    """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(__lowerCAmelCase  )  )






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			[
														    """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""",
														]
														UpperCamelCase__				     =			"""fp16"""
														self.assertTrue(is_safetensors_compatible(__lowerCAmelCase  , variant=__lowerCAmelCase  )  )






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			[
														    """unet/diffusion_pytorch_model.fp16.bin""",
														    """unet/diffusion_pytorch_model.fp16.safetensors""",
														]
														UpperCamelCase__				     =			"""fp16"""
														self.assertTrue(is_safetensors_compatible(__lowerCAmelCase  , variant=__lowerCAmelCase  )  )






							def 				_lowerCamelCase		(						self  ):
														# pass variant but use the non-variant filenames
														UpperCamelCase__				     =			[
														    """unet/diffusion_pytorch_model.bin""",
														    """unet/diffusion_pytorch_model.safetensors""",
														]
														UpperCamelCase__				     =			"""fp16"""
														self.assertTrue(is_safetensors_compatible(__lowerCAmelCase  , variant=__lowerCAmelCase  )  )






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			[
														    """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',
														]
														UpperCamelCase__				     =			"""fp16"""
														self.assertFalse(is_safetensors_compatible(__lowerCAmelCase  , variant=__lowerCAmelCase  )  )






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			[
														    """text_encoder/pytorch_model.fp16.bin""",
														    """text_encoder/model.fp16.safetensors""",
														]
														UpperCamelCase__				     =			"""fp16"""
														self.assertTrue(is_safetensors_compatible(__lowerCAmelCase  , variant=__lowerCAmelCase  )  )






							def 				_lowerCamelCase		(						self  ):
														# pass variant but use the non-variant filenames
														UpperCamelCase__				     =			[
														    """text_encoder/pytorch_model.bin""",
														    """text_encoder/model.safetensors""",
														]
														UpperCamelCase__				     =			"""fp16"""
														self.assertTrue(is_safetensors_compatible(__lowerCAmelCase  , variant=__lowerCAmelCase  )  )







							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			[
														    """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""",
														]
														UpperCamelCase__				     =			"""fp16"""
														self.assertFalse(is_safetensors_compatible(__lowerCAmelCase  , variant=__lowerCAmelCase  )  )











import inspect
import unittest

class        __SCREAMING_SNAKE_CASE					(     unittest.TestCase       ):






							def 				_lowerCamelCase		(						self  ):
														try:
																					import diffusers  # noqa: F401
														except ImportError:
																					assert False







							def 				_lowerCamelCase		(						self  ):
														import diffusers
														from diffusers.dependency_versions_table import deps

														UpperCamelCase__				     =			inspect.getmembers(__lowerCAmelCase  , 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":
																																										UpperCamelCase__				     =			"""k-diffusion"""
																																			elif backend == "invisible_watermark":
																																										UpperCamelCase__				     =			"""invisible-watermark"""
																																			assert backend in deps, f"""{backend} is not in the deps table!"""




