





import inspect
import os
import sys
import unittest

import accelerate
from accelerate.test_utils import execute_subprocess_async, require_tpu
class SCREAMING_SNAKE_CASE_  (    unittest.TestCase    ):






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







							"""simple docstring"""


							snake_case_						:	List[str]      =		inspect.getfile(accelerate.test_utils		)
							snake_case_						:	Union[str, Any]      =		os.path.sep.join(mod_file.split(os.path.sep		)[:-1] + ['scripts', 'test_script.py']		)
							snake_case_						:	List[str]      =		os.path.sep.join(inspect.getfile(self.__class__		).split(os.path.sep		)[:-1]		)






						@require_tpu
						def UpperCAmelCase_ (					self					:					Tuple		)							->			Union[str, Any]:







							"""simple docstring"""


							snake_case_						:	Optional[int]      =		F"""
            {self.test_dir}/xla_spawn.py
            --num_cores 8
            {self.test_file_path}
        """.split()
							snake_case_						:	Any      =		[sys.executable] + distributed_args
							execute_subprocess_async(_A						,      env=os.environ.copy()		)








from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
	if not (is_transformers_available() and is_torch_available() and is_transformers_version('''>=''', '''4.25.0''')):
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	from ...utils.dummy_torch_and_transformers_objects import UnCLIPImageVariationPipeline, UnCLIPPipeline
else:
	from .pipeline_unclip import UnCLIPPipeline
	from .pipeline_unclip_image_variation import UnCLIPImageVariationPipeline
	from .text_proj import UnCLIPTextProjModel
