"""simple docstring"""




import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible
class 		__A							(				unittest.TestCase	):






     def 					__A						(	self						):
       _lowerCAmelCase		: 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''',
           '''text_encoder/model.safetensors''',
           '''unet/diffusion_pytorch_model.bin''',
           '''unet/diffusion_pytorch_model.safetensors''',
       ]
       self.assertTrue(is_safetensors_compatible(a__						)						)






     def 					__A						(	self						):
       _lowerCAmelCase		: List[str]						    =  [
           '''unet/diffusion_pytorch_model.bin''',
           '''unet/diffusion_pytorch_model.safetensors''',
       ]
       self.assertTrue(is_safetensors_compatible(a__						)						)






     def 					__A						(	self						):
       _lowerCAmelCase		: Optional[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(a__						)						)






     def 					__A						(	self						):
       _lowerCAmelCase		: str						    =  [
           '''text_encoder/pytorch_model.bin''',
           '''text_encoder/model.safetensors''',
       ]
       self.assertTrue(is_safetensors_compatible(a__						)						)






     def 					__A						(	self						):
       _lowerCAmelCase		: List[str]						    =  [
           '''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(a__						)						)






     def 					__A						(	self						):
       _lowerCAmelCase		: Optional[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''',
           '''unet/diffusion_pytorch_model.fp16.safetensors''',
       ]
       _lowerCAmelCase		: Any						    =  '''fp16'''
       self.assertTrue(is_safetensors_compatible(a__       ,  variant=a__						)						)






     def 					__A						(	self						):
       _lowerCAmelCase		: List[str]						    =  [
           '''unet/diffusion_pytorch_model.fp16.bin''',
           '''unet/diffusion_pytorch_model.fp16.safetensors''',
       ]
       _lowerCAmelCase		: Dict						    =  '''fp16'''
       self.assertTrue(is_safetensors_compatible(a__       ,  variant=a__						)						)






     def 					__A						(	self						):
       # pass variant but use the non-variant filenames
       _lowerCAmelCase		: List[str]						    =  [
           '''unet/diffusion_pytorch_model.bin''',
           '''unet/diffusion_pytorch_model.safetensors''',
       ]
       _lowerCAmelCase		: Union[str, Any]						    =  '''fp16'''
       self.assertTrue(is_safetensors_compatible(a__       ,  variant=a__						)						)






     def 					__A						(	self						):
       _lowerCAmelCase		: Dict						    =  [
           '''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',
       ]
       _lowerCAmelCase		: List[Any]						    =  '''fp16'''
       self.assertFalse(is_safetensors_compatible(a__       ,  variant=a__						)						)






     def 					__A						(	self						):
       _lowerCAmelCase		: int						    =  [
           '''text_encoder/pytorch_model.fp16.bin''',
           '''text_encoder/model.fp16.safetensors''',
       ]
       _lowerCAmelCase		: Any						    =  '''fp16'''
       self.assertTrue(is_safetensors_compatible(a__       ,  variant=a__						)						)






     def 					__A						(	self						):
       # pass variant but use the non-variant filenames
       _lowerCAmelCase		: Optional[int]						    =  [
           '''text_encoder/pytorch_model.bin''',
           '''text_encoder/model.safetensors''',
       ]
       _lowerCAmelCase		: str						    =  '''fp16'''
       self.assertTrue(is_safetensors_compatible(a__       ,  variant=a__						)						)






     def 					__A						(	self						):
       _lowerCAmelCase		: Tuple						    =  [
           '''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''',
       ]
       _lowerCAmelCase		: str						    =  '''fp16'''
       self.assertFalse(is_safetensors_compatible(a__       ,  variant=a__						)						)


"""simple docstring"""




from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
     if not (is_transformers_available() and is_torch_available() and is_transformers_version('>=', '4.25.0')):
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     from ...utils.dummy_torch_and_transformers_objects import UnCLIPImageVariationPipeline, UnCLIPPipeline
else:
     from .pipeline_unclip import UnCLIPPipeline
     from .pipeline_unclip_image_variation import UnCLIPImageVariationPipeline
     from .text_proj import UnCLIPTextProjModel




