





from pathlib import Path

import fire






def 					SCREAMING_SNAKE_CASE__				(							UpperCamelCase__:				str       , UpperCamelCase__:				str       , UpperCamelCase__:				int     ):
		SCREAMING_SNAKE_CASE__								=   Path(UpperCamelCase__     )
		SCREAMING_SNAKE_CASE__								=   Path(UpperCamelCase__     )
		dest_dir.mkdir(exist_ok=UpperCamelCase__     )
		for path in src_dir.iterdir():
				SCREAMING_SNAKE_CASE__								=   [x.rstrip() for x in list(path.open().readlines()     )][:n]
				SCREAMING_SNAKE_CASE__								=   dest_dir.joinpath(path.name     )
				print(UpperCamelCase__     )
				dest_path.open("""w"""     ).write("""\n""".join(UpperCamelCase__     )     )


if __name__ == "__main__":
	fire.Fire(minify)






import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible




class 	UpperCamelCase_							(  unittest.TestCase     ):


							def   _snake_case	(				self     :Tuple		) -> Any:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """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   _snake_case	(				self     :List[str]		) -> int:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """unet/diffusion_pytorch_model.bin""",
									    """unet/diffusion_pytorch_model.safetensors""",
									]
									self.assertTrue(is_safetensors_compatible(__A		)		)


							def   _snake_case	(				self     :Tuple		) -> Optional[Any]:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """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   _snake_case	(				self     :Union[str, Any]		) -> Union[str, Any]:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """text_encoder/pytorch_model.bin""",
									    """text_encoder/model.safetensors""",
									]
									self.assertTrue(is_safetensors_compatible(__A		)		)


							def   _snake_case	(				self     :Optional[Any]		) -> Any:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """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   _snake_case	(				self     :Tuple		) -> List[Any]:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """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__								=   """fp16"""
									self.assertTrue(is_safetensors_compatible(__A				,					variant=__A		)		)


							def   _snake_case	(				self     :Any		) -> Tuple:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """unet/diffusion_pytorch_model.fp16.bin""",
									    """unet/diffusion_pytorch_model.fp16.safetensors""",
									]
									SCREAMING_SNAKE_CASE__								=   """fp16"""
									self.assertTrue(is_safetensors_compatible(__A				,					variant=__A		)		)


							def   _snake_case	(				self     :str		) -> Tuple:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """unet/diffusion_pytorch_model.bin""",
									    """unet/diffusion_pytorch_model.safetensors""",
									]
									SCREAMING_SNAKE_CASE__								=   """fp16"""
									self.assertTrue(is_safetensors_compatible(__A				,					variant=__A		)		)


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



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """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__								=   """fp16"""
									self.assertFalse(is_safetensors_compatible(__A				,					variant=__A		)		)


							def   _snake_case	(				self     :str		) -> List[str]:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """text_encoder/pytorch_model.fp16.bin""",
									    """text_encoder/model.fp16.safetensors""",
									]
									SCREAMING_SNAKE_CASE__								=   """fp16"""
									self.assertTrue(is_safetensors_compatible(__A				,					variant=__A		)		)


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



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """text_encoder/pytorch_model.bin""",
									    """text_encoder/model.safetensors""",
									]
									SCREAMING_SNAKE_CASE__								=   """fp16"""
									self.assertTrue(is_safetensors_compatible(__A				,					variant=__A		)		)


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



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   [
									    """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__								=   """fp16"""
									self.assertFalse(is_safetensors_compatible(__A				,					variant=__A		)		)