import warnings

from ...utils import logging
from .image_processing_flava import FlavaImageProcessor


lowercase_     :   Dict 				=				logging.get_logger(__name__)






class 		_lowerCamelCase		(   UpperCamelCase_    ):
    def __init__(  self , *lowerCAmelCase , **lowerCAmelCase   )       ->					None:
     warnings.warn(
         '''The class FlavaFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please'''
         ''' use FlavaImageProcessor instead.''' , lowerCAmelCase , )
     super().__init__(*lowerCAmelCase , **lowerCAmelCase   )


import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible






class 		_lowerCamelCase		(   unittest.TestCase    ):
    def 						UpperCamelCase_				(  self   )       ->					str:
     SCREAMING_SNAKE_CASE__:   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(lowerCAmelCase   )   )
    def 						UpperCamelCase_				(  self   )       ->					int:
     SCREAMING_SNAKE_CASE__:   List[str]=      [
         '''unet/diffusion_pytorch_model.bin''',
         '''unet/diffusion_pytorch_model.safetensors''',
     ]
     self.assertTrue(is_safetensors_compatible(lowerCAmelCase   )   )
    def 						UpperCamelCase_				(  self   )       ->					Tuple:
     SCREAMING_SNAKE_CASE__:   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(lowerCAmelCase   )   )
    def 						UpperCamelCase_				(  self   )       ->					Dict:
     SCREAMING_SNAKE_CASE__:   str=      [
         '''text_encoder/pytorch_model.bin''',
         '''text_encoder/model.safetensors''',
     ]
     self.assertTrue(is_safetensors_compatible(lowerCAmelCase   )   )
    def 						UpperCamelCase_				(  self   )       ->					str:
     SCREAMING_SNAKE_CASE__:   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(lowerCAmelCase   )   )
    def 						UpperCamelCase_				(  self   )       ->					List[str]:
     SCREAMING_SNAKE_CASE__:   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''',
     ]
     SCREAMING_SNAKE_CASE__:   Any=      '''fp16'''
     self.assertTrue(is_safetensors_compatible(lowerCAmelCase , variant=lowerCAmelCase   )   )
    def 						UpperCamelCase_				(  self   )       ->					Any:
     SCREAMING_SNAKE_CASE__:   List[str]=      [
         '''unet/diffusion_pytorch_model.fp16.bin''',
         '''unet/diffusion_pytorch_model.fp16.safetensors''',
     ]
     SCREAMING_SNAKE_CASE__:   Dict=      '''fp16'''
     self.assertTrue(is_safetensors_compatible(lowerCAmelCase , variant=lowerCAmelCase   )   )
    def 						UpperCamelCase_				(  self   )       ->					Dict:
     # pass variant but use the non-variant filenames
     SCREAMING_SNAKE_CASE__:   List[str]=      [
         '''unet/diffusion_pytorch_model.bin''',
         '''unet/diffusion_pytorch_model.safetensors''',
     ]
     SCREAMING_SNAKE_CASE__:   Union[str, Any]=      '''fp16'''
     self.assertTrue(is_safetensors_compatible(lowerCAmelCase , variant=lowerCAmelCase   )   )
    def 						UpperCamelCase_				(  self   )       ->					List[Any]:
     SCREAMING_SNAKE_CASE__:   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',
     ]
     SCREAMING_SNAKE_CASE__:   List[Any]=      '''fp16'''
     self.assertFalse(is_safetensors_compatible(lowerCAmelCase , variant=lowerCAmelCase   )   )
    def 						UpperCamelCase_				(  self   )       ->					List[str]:
     SCREAMING_SNAKE_CASE__:   int=      [
         '''text_encoder/pytorch_model.fp16.bin''',
         '''text_encoder/model.fp16.safetensors''',
     ]
     SCREAMING_SNAKE_CASE__:   Any=      '''fp16'''
     self.assertTrue(is_safetensors_compatible(lowerCAmelCase , variant=lowerCAmelCase   )   )
    def 						UpperCamelCase_				(  self   )       ->					Optional[Any]:
     # pass variant but use the non-variant filenames
     SCREAMING_SNAKE_CASE__:   Optional[int]=      [
         '''text_encoder/pytorch_model.bin''',
         '''text_encoder/model.safetensors''',
     ]
     SCREAMING_SNAKE_CASE__:   str=      '''fp16'''
     self.assertTrue(is_safetensors_compatible(lowerCAmelCase , variant=lowerCAmelCase   )   )



    def 						UpperCamelCase_				(  self   )       ->					Union[str, Any]:
     SCREAMING_SNAKE_CASE__:   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''',
     ]
     SCREAMING_SNAKE_CASE__:   str=      '''fp16'''
     self.assertFalse(is_safetensors_compatible(lowerCAmelCase , variant=lowerCAmelCase   )   )

