





'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


lowercase__						:      List[str]	=    {
    'configuration_pix2struct': [
        'PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'Pix2StructConfig',
        'Pix2StructTextConfig',
        'Pix2StructVisionConfig',
    ],
    'processing_pix2struct': ['Pix2StructProcessor'],
}

try:
			if not is_vision_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowercase__						:      int	=    ['Pix2StructImageProcessor']


try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowercase__						:      List[Any]	=    [
			    'PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'Pix2StructPreTrainedModel',
			    'Pix2StructForConditionalGeneration',
			    'Pix2StructVisionModel',
			    'Pix2StructTextModel',
			]

if TYPE_CHECKING:
			from .configuration_pixastruct import (
			    PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP,
			    PixaStructConfig,
			    PixaStructTextConfig,
			    PixaStructVisionConfig,
			)
			from .processing_pixastruct import PixaStructProcessor

			try:
						if not is_vision_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .image_processing_pixastruct import PixaStructImageProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_pixastruct import (
						    PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    PixaStructForConditionalGeneration,
						    PixaStructPreTrainedModel,
						    PixaStructTextModel,
						    PixaStructVisionModel,
						)

else:
			import sys

			lowercase__						:      Optional[Any]	=    _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)










'''simple docstring'''

import unittest

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






       """simple docstring"""





       def snake_case__						(							self       :		Tuple					)   ->					int:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''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 snake_case__						(							self       :		int					)   ->					Tuple:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''unet/diffusion_pytorch_model.bin''',
                '''unet/diffusion_pytorch_model.safetensors''',
            ]
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__					)					)





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

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''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 snake_case__						(							self       :		List[Any]					)   ->					List[Any]:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''text_encoder/pytorch_model.bin''',
                '''text_encoder/model.safetensors''',
            ]
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__					)					)





       def snake_case__						(							self       :		Dict					)   ->					Dict:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''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 snake_case__						(							self       :		Any					)   ->					Optional[int]:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''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''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)





       def snake_case__						(							self       :		Optional[Any]					)   ->					Dict:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''unet/diffusion_pytorch_model.fp16.bin''',
                '''unet/diffusion_pytorch_model.fp16.safetensors''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)





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

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''unet/diffusion_pytorch_model.bin''',
                '''unet/diffusion_pytorch_model.safetensors''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)





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

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''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',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertFalse(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)





       def snake_case__						(							self       :		Optional[int]					)   ->					Dict:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''text_encoder/pytorch_model.fp16.bin''',
                '''text_encoder/model.fp16.safetensors''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)





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

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''text_encoder/pytorch_model.bin''',
                '''text_encoder/model.safetensors''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)







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

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''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''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertFalse(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)



