



"""simple docstring"""







import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible







class 				UpperCamelCase__       (     unittest.TestCase  ):




      """simple docstring"""




      def 					SCREAMING_SNAKE_CASE__			(				self    :				Dict	):
        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',
            'unet/diffusion_pytorch_model.safetensors',
        ]
        self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE_	)	)



      def 					SCREAMING_SNAKE_CASE__			(				self    :				str	):
        lowerCAmelCase_       :    int								=			[
            'unet/diffusion_pytorch_model.bin',
            'unet/diffusion_pytorch_model.safetensors',
        ]
        self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE_	)	)



      def 					SCREAMING_SNAKE_CASE__			(				self    :				Union[str, Any]	):
        lowerCAmelCase_       :    Dict								=			[
            '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(SCREAMING_SNAKE_CASE_	)	)



      def 					SCREAMING_SNAKE_CASE__			(				self    :				str	):
        lowerCAmelCase_       :    List[Any]								=			[
            'text_encoder/pytorch_model.bin',
            'text_encoder/model.safetensors',
        ]
        self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE_	)	)



      def 					SCREAMING_SNAKE_CASE__			(				self    :				Tuple	):
        lowerCAmelCase_       :    Union[str, 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(SCREAMING_SNAKE_CASE_	)	)



      def 					SCREAMING_SNAKE_CASE__			(				self    :				int	):
        lowerCAmelCase_       :    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',
        ]
        lowerCAmelCase_       :    Optional[int]								=			'fp16'
        self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE_   ,      variant=SCREAMING_SNAKE_CASE_	)	)



      def 					SCREAMING_SNAKE_CASE__			(				self    :				Tuple	):
        lowerCAmelCase_       :    Optional[Any]								=			[
            'unet/diffusion_pytorch_model.fp16.bin',
            'unet/diffusion_pytorch_model.fp16.safetensors',
        ]
        lowerCAmelCase_       :    Optional[Any]								=			'fp16'
        self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE_   ,      variant=SCREAMING_SNAKE_CASE_	)	)



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



      def 					SCREAMING_SNAKE_CASE__			(				self    :				Optional[Any]	):
        lowerCAmelCase_       :    List[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',
            # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
        ]
        lowerCAmelCase_       :    str								=			'fp16'
        self.assertFalse(is_safetensors_compatible(SCREAMING_SNAKE_CASE_   ,      variant=SCREAMING_SNAKE_CASE_	)	)



      def 					SCREAMING_SNAKE_CASE__			(				self    :				List[Any]	):
        lowerCAmelCase_       :    int								=			[
            'text_encoder/pytorch_model.fp16.bin',
            'text_encoder/model.fp16.safetensors',
        ]
        lowerCAmelCase_       :    Optional[int]								=			'fp16'
        self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE_   ,      variant=SCREAMING_SNAKE_CASE_	)	)



      def 					SCREAMING_SNAKE_CASE__			(				self    :				Union[str, Any]	):
        # pass variant but use the non-variant filenames
        lowerCAmelCase_       :    Tuple								=			[
            'text_encoder/pytorch_model.bin',
            'text_encoder/model.safetensors',
        ]
        lowerCAmelCase_       :    Tuple								=			'fp16'
        self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE_   ,      variant=SCREAMING_SNAKE_CASE_	)	)





      def 					SCREAMING_SNAKE_CASE__			(				self    :				Tuple	):
        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(SCREAMING_SNAKE_CASE_   ,      variant=SCREAMING_SNAKE_CASE_	)	)










"""simple docstring"""







def     UpperCamelCase_   (   lowerCAmelCase__				:    str   ,       lowerCAmelCase__				:    str						)						->       int:

  """simple docstring"""




  if len(lowerCAmelCase__						) != len(lowerCAmelCase__						):
    raise ValueError('String lengths must match!'						)

  lowerCAmelCase_       :    List[Any]								=			0

  for chara, chara in zip(lowerCAmelCase__   ,       lowerCAmelCase__						):
    if chara != chara:
      count += 1

  return count


if __name__ == "__main__":
     import doctest

     doctest.testmod()





