





import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible



class      _SCREAMING_SNAKE_CASE		(			unittest.TestCase					):







	'''simple docstring'''

	def 							SCREAMING_SNAKE_CASE_      (self       :     Any) ->Any:



			'''simple docstring'''



			lowerCamelCase__:   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(UpperCAmelCase_))

	def 							SCREAMING_SNAKE_CASE_      (self       :     Union[str, Any]) ->Tuple:



			'''simple docstring'''



			lowerCamelCase__:   Optional[Any]    						=[
			    'unet/diffusion_pytorch_model.bin',
			    'unet/diffusion_pytorch_model.safetensors',
			]
			self.assertTrue(is_safetensors_compatible(UpperCAmelCase_))

	def 							SCREAMING_SNAKE_CASE_      (self       :     Dict) ->str:



			'''simple docstring'''



			lowerCamelCase__:   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(UpperCAmelCase_))

	def 							SCREAMING_SNAKE_CASE_      (self       :     Optional[int]) ->Optional[Any]:



			'''simple docstring'''



			lowerCamelCase__:   Dict    						=[
			    'text_encoder/pytorch_model.bin',
			    'text_encoder/model.safetensors',
			]
			self.assertTrue(is_safetensors_compatible(UpperCAmelCase_))

	def 							SCREAMING_SNAKE_CASE_      (self       :     List[Any]) ->Union[str, Any]:



			'''simple docstring'''



			lowerCamelCase__:   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',
			    # Removed: 'text_encoder/model.safetensors',
			    'unet/diffusion_pytorch_model.bin',
			    'unet/diffusion_pytorch_model.safetensors',
			]
			self.assertFalse(is_safetensors_compatible(UpperCAmelCase_))

	def 							SCREAMING_SNAKE_CASE_      (self       :     str) ->Optional[int]:



			'''simple docstring'''



			lowerCamelCase__:   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',
			]
			lowerCamelCase__:   Union[str, Any]    						='fp16'
			self.assertTrue(is_safetensors_compatible(UpperCAmelCase_ ,				variant=UpperCAmelCase_))

	def 							SCREAMING_SNAKE_CASE_      (self       :     int) ->Tuple:



			'''simple docstring'''



			lowerCamelCase__:   Tuple    						=[
			    'unet/diffusion_pytorch_model.fp16.bin',
			    'unet/diffusion_pytorch_model.fp16.safetensors',
			]
			lowerCamelCase__:   Any    						='fp16'
			self.assertTrue(is_safetensors_compatible(UpperCAmelCase_ ,				variant=UpperCAmelCase_))

	def 							SCREAMING_SNAKE_CASE_      (self       :     int) ->int:



			'''simple docstring'''



			lowerCamelCase__:   Any    						=[
			    'unet/diffusion_pytorch_model.bin',
			    'unet/diffusion_pytorch_model.safetensors',
			]
			lowerCamelCase__:   Tuple    						='fp16'
			self.assertTrue(is_safetensors_compatible(UpperCAmelCase_ ,				variant=UpperCAmelCase_))

	def 							SCREAMING_SNAKE_CASE_      (self       :     Union[str, Any]) ->Union[str, Any]:



			'''simple docstring'''



			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',
			    # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
			]
			lowerCamelCase__:   Any    						='fp16'
			self.assertFalse(is_safetensors_compatible(UpperCAmelCase_ ,				variant=UpperCAmelCase_))

	def 							SCREAMING_SNAKE_CASE_      (self       :     str) ->Optional[Any]:



			'''simple docstring'''



			lowerCamelCase__:   Union[str, Any]    						=[
			    'text_encoder/pytorch_model.fp16.bin',
			    'text_encoder/model.fp16.safetensors',
			]
			lowerCamelCase__:   Optional[int]    						='fp16'
			self.assertTrue(is_safetensors_compatible(UpperCAmelCase_ ,				variant=UpperCAmelCase_))

	def 							SCREAMING_SNAKE_CASE_      (self       :     List[Any]) ->List[Any]:



			'''simple docstring'''



			lowerCamelCase__:   Union[str, Any]    						=[
			    'text_encoder/pytorch_model.bin',
			    'text_encoder/model.safetensors',
			]
			lowerCamelCase__:   Any    						='fp16'
			self.assertTrue(is_safetensors_compatible(UpperCAmelCase_ ,				variant=UpperCAmelCase_))







	def 							SCREAMING_SNAKE_CASE_      (self       :     Union[str, Any]) ->Tuple:



			'''simple docstring'''



			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.assertFalse(is_safetensors_compatible(UpperCAmelCase_ ,				variant=UpperCAmelCase_))








import os
import sys
import unittest


__A             =       os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
sys.path.append(os.path.join(git_repo_path, "utils"))

import get_test_info  # noqa: E402
from get_test_info import (  # noqa: E402
    get_model_to_test_mapping,
    get_model_to_tester_mapping,
    get_test_to_tester_mapping,
)


__A             =       os.path.join("tests", "models", "bert", "test_modeling_bert.py")
__A             =       os.path.join("tests", "models", "blip", "test_modeling_blip.py")



class      _SCREAMING_SNAKE_CASE		(			unittest.TestCase					):







 '''simple docstring'''

 def 							SCREAMING_SNAKE_CASE_      (self       :     List[Any]) ->str:



   '''simple docstring'''



   lowerCamelCase__:   List[str]    						=get_test_to_tester_mapping(UpperCAmelCase_)
   lowerCamelCase__:   List[str]    						=get_test_to_tester_mapping(UpperCAmelCase_)

   lowerCamelCase__:   List[Any]    						={"BertModelTest": "BertModelTester"}

   lowerCamelCase__:   Optional[int]    						={
       "BlipModelTest": "BlipModelTester",
       "BlipTextImageModelTest": "BlipTextImageModelsModelTester",
       "BlipTextModelTest": "BlipTextModelTester",
       "BlipTextRetrievalModelTest": "BlipTextRetrievalModelTester",
       "BlipVQAModelTest": "BlipVQAModelTester",
       "BlipVisionModelTest": "BlipVisionModelTester",
   }

   self.assertEqual(get_test_info.to_json(UpperCAmelCase_) ,				UpperCAmelCase_)
   self.assertEqual(get_test_info.to_json(UpperCAmelCase_) ,				UpperCAmelCase_)

 def 							SCREAMING_SNAKE_CASE_      (self       :     Optional[Any]) ->str:



   '''simple docstring'''



   lowerCamelCase__:   str    						=get_model_to_test_mapping(UpperCAmelCase_)
   lowerCamelCase__:   int    						=get_model_to_test_mapping(UpperCAmelCase_)

   lowerCamelCase__:   Tuple    						={
       "BertForMaskedLM": ["BertModelTest"],
       "BertForMultipleChoice": ["BertModelTest"],
       "BertForNextSentencePrediction": ["BertModelTest"],
       "BertForPreTraining": ["BertModelTest"],
       "BertForQuestionAnswering": ["BertModelTest"],
       "BertForSequenceClassification": ["BertModelTest"],
       "BertForTokenClassification": ["BertModelTest"],
       "BertLMHeadModel": ["BertModelTest"],
       "BertModel": ["BertModelTest"],
   }

   lowerCamelCase__:   Any    						={
       "BlipForConditionalGeneration": ["BlipTextImageModelTest"],
       "BlipForImageTextRetrieval": ["BlipTextRetrievalModelTest"],
       "BlipForQuestionAnswering": ["BlipVQAModelTest"],
       "BlipModel": ["BlipModelTest"],
       "BlipTextModel": ["BlipTextModelTest"],
       "BlipVisionModel": ["BlipVisionModelTest"],
   }

   self.assertEqual(get_test_info.to_json(UpperCAmelCase_) ,				UpperCAmelCase_)
   self.assertEqual(get_test_info.to_json(UpperCAmelCase_) ,				UpperCAmelCase_)







 def 							SCREAMING_SNAKE_CASE_      (self       :     Optional[int]) ->Any:



   '''simple docstring'''



   lowerCamelCase__:   Optional[Any]    						=get_model_to_tester_mapping(UpperCAmelCase_)
   lowerCamelCase__:   Optional[Any]    						=get_model_to_tester_mapping(UpperCAmelCase_)

   lowerCamelCase__:   Any    						={
       "BertForMaskedLM": ["BertModelTester"],
       "BertForMultipleChoice": ["BertModelTester"],
       "BertForNextSentencePrediction": ["BertModelTester"],
       "BertForPreTraining": ["BertModelTester"],
       "BertForQuestionAnswering": ["BertModelTester"],
       "BertForSequenceClassification": ["BertModelTester"],
       "BertForTokenClassification": ["BertModelTester"],
       "BertLMHeadModel": ["BertModelTester"],
       "BertModel": ["BertModelTester"],
   }

   lowerCamelCase__:   Optional[Any]    						={
       "BlipForConditionalGeneration": ["BlipTextImageModelsModelTester"],
       "BlipForImageTextRetrieval": ["BlipTextRetrievalModelTester"],
       "BlipForQuestionAnswering": ["BlipVQAModelTester"],
       "BlipModel": ["BlipModelTester"],
       "BlipTextModel": ["BlipTextModelTester"],
       "BlipVisionModel": ["BlipVisionModelTester"],
   }

   self.assertEqual(get_test_info.to_json(UpperCAmelCase_) ,				UpperCAmelCase_)
   self.assertEqual(get_test_info.to_json(UpperCAmelCase_) ,				UpperCAmelCase_)

