
"""simple docstring"""







import unittest

from transformers import YosoConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
							import torch

							from transformers import (
							    YosoForMaskedLM,
							    YosoForMultipleChoice,
							    YosoForQuestionAnswering,
							    YosoForSequenceClassification,
							    YosoForTokenClassification,
							    YosoModel,
							)
							from transformers.models.yoso.modeling_yoso import YOSO_PRETRAINED_MODEL_ARCHIVE_LIST




class 					A__			:

		def __init__( self			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE=13			,						_SCREAMING_SNAKE_CASE=7			,						_SCREAMING_SNAKE_CASE=True			,						_SCREAMING_SNAKE_CASE=True			,						_SCREAMING_SNAKE_CASE=True			,						_SCREAMING_SNAKE_CASE=True			,						_SCREAMING_SNAKE_CASE=99			,						_SCREAMING_SNAKE_CASE=32			,						_SCREAMING_SNAKE_CASE=5			,						_SCREAMING_SNAKE_CASE=4			,						_SCREAMING_SNAKE_CASE=37			,						_SCREAMING_SNAKE_CASE="gelu"			,						_SCREAMING_SNAKE_CASE=0.1			,						_SCREAMING_SNAKE_CASE=0.1			,						_SCREAMING_SNAKE_CASE=5_12			,						_SCREAMING_SNAKE_CASE=16			,						_SCREAMING_SNAKE_CASE=2			,						_SCREAMING_SNAKE_CASE=0.02			,						_SCREAMING_SNAKE_CASE=3			,						_SCREAMING_SNAKE_CASE=4			,						_SCREAMING_SNAKE_CASE=None			,						):
			__lowerCAmelCase     :		Union[str, Any]		     = parent
			__lowerCAmelCase     :		Optional[int]		     = batch_size
			__lowerCAmelCase     :		List[str]		     = seq_length
			__lowerCAmelCase     :		List[str]		     = is_training
			__lowerCAmelCase     :		str		     = use_input_mask
			__lowerCAmelCase     :		Dict		     = use_token_type_ids
			__lowerCAmelCase     :		List[Any]		     = use_labels
			__lowerCAmelCase     :		int		     = vocab_size
			__lowerCAmelCase     :		List[str]		     = hidden_size
			__lowerCAmelCase     :		str		     = num_hidden_layers
			__lowerCAmelCase     :		str		     = num_attention_heads
			__lowerCAmelCase     :		Any		     = intermediate_size
			__lowerCAmelCase     :		Tuple		     = hidden_act
			__lowerCAmelCase     :		List[str]		     = hidden_dropout_prob
			__lowerCAmelCase     :		str		     = attention_probs_dropout_prob
			__lowerCAmelCase     :		Tuple		     = max_position_embeddings
			__lowerCAmelCase     :		int		     = type_vocab_size
			__lowerCAmelCase     :		List[Any]		     = type_sequence_label_size
			__lowerCAmelCase     :		List[str]		     = initializer_range
			__lowerCAmelCase     :		Optional[int]		     = num_labels
			__lowerCAmelCase     :		Tuple		     = num_choices
			__lowerCAmelCase     :		int		     = scope

		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		Tuple		     = ids_tensor([self.batch_size, self.seq_length]			,						self.vocab_size					)

			__lowerCAmelCase     :		List[str]		     = None
			if self.use_input_mask:
				__lowerCAmelCase     :		List[str]		     = random_attention_mask([self.batch_size, self.seq_length]					)

			__lowerCAmelCase     :		Dict		     = None
			if self.use_token_type_ids:
				__lowerCAmelCase     :		str		     = ids_tensor([self.batch_size, self.seq_length]			,						self.type_vocab_size					)

			__lowerCAmelCase     :		int		     = None
			__lowerCAmelCase     :		List[str]		     = None
			__lowerCAmelCase     :		Union[str, Any]		     = None
			if self.use_labels:
				__lowerCAmelCase     :		Optional[int]		     = ids_tensor([self.batch_size]			,						self.type_sequence_label_size					)
				__lowerCAmelCase     :		Any		     = ids_tensor([self.batch_size, self.seq_length]			,						self.num_labels					)
				__lowerCAmelCase     :		int		     = ids_tensor([self.batch_size]			,						self.num_choices					)

			__lowerCAmelCase     :		int		     = self.get_config()

			return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels

		def 				__lowerCamelCase				( self					):
			return YosoConfig(
			    vocab_size=self.vocab_size			,						hidden_size=self.hidden_size			,						num_hidden_layers=self.num_hidden_layers			,						num_attention_heads=self.num_attention_heads			,						intermediate_size=self.intermediate_size			,						hidden_act=self.hidden_act			,						hidden_dropout_prob=self.hidden_dropout_prob			,						attention_probs_dropout_prob=self.attention_probs_dropout_prob			,						max_position_embeddings=self.max_position_embeddings			,						type_vocab_size=self.type_vocab_size			,						is_decoder=_SCREAMING_SNAKE_CASE			,						initializer_range=self.initializer_range			,						)

		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		List[Any]		     = self.get_config()
			__lowerCAmelCase     :		str		     = 3_00
			return config

		def 				__lowerCamelCase				( self					):
			(
			    (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  
			)     :		List[str]		     = self.prepare_config_and_inputs()

			__lowerCAmelCase     :		Tuple		     = True
			__lowerCAmelCase     :		Tuple		     = floats_tensor([self.batch_size, self.seq_length, self.hidden_size]					)
			__lowerCAmelCase     :		int		     = ids_tensor([self.batch_size, self.seq_length]			,						vocab_size=2					)

			return (
			    config,
			    input_ids,
			    token_type_ids,
			    input_mask,
			    sequence_labels,
			    token_labels,
			    choice_labels,
			    encoder_hidden_states,
			    encoder_attention_mask,
			)

		def 				__lowerCamelCase				( self			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE					):
			__lowerCAmelCase     :		str		     = YosoModel(config=_SCREAMING_SNAKE_CASE					)
			model.to(_SCREAMING_SNAKE_CASE					)
			model.eval()
			__lowerCAmelCase     :		Optional[Any]		     = model(_SCREAMING_SNAKE_CASE			,						attention_mask=_SCREAMING_SNAKE_CASE			,						token_type_ids=_SCREAMING_SNAKE_CASE					)
			__lowerCAmelCase     :		Tuple		     = model(_SCREAMING_SNAKE_CASE			,						token_type_ids=_SCREAMING_SNAKE_CASE					)
			__lowerCAmelCase     :		Any		     = model(_SCREAMING_SNAKE_CASE					)
			self.parent.assertEqual(result.last_hidden_state.shape			,						(self.batch_size, self.seq_length, self.hidden_size)					)

		def 				__lowerCamelCase				( self			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						):
			__lowerCAmelCase     :		Optional[int]		     = True
			__lowerCAmelCase     :		Tuple		     = YosoModel(_SCREAMING_SNAKE_CASE					)
			model.to(_SCREAMING_SNAKE_CASE					)
			model.eval()
			__lowerCAmelCase     :		List[Any]		     = model(
			    _SCREAMING_SNAKE_CASE			,						attention_mask=_SCREAMING_SNAKE_CASE			,						token_type_ids=_SCREAMING_SNAKE_CASE			,						encoder_hidden_states=_SCREAMING_SNAKE_CASE			,						encoder_attention_mask=_SCREAMING_SNAKE_CASE			,						)
			__lowerCAmelCase     :		Any		     = model(
			    _SCREAMING_SNAKE_CASE			,						attention_mask=_SCREAMING_SNAKE_CASE			,						token_type_ids=_SCREAMING_SNAKE_CASE			,						encoder_hidden_states=_SCREAMING_SNAKE_CASE			,						)
			__lowerCAmelCase     :		Optional[Any]		     = model(_SCREAMING_SNAKE_CASE			,						attention_mask=_SCREAMING_SNAKE_CASE			,						token_type_ids=_SCREAMING_SNAKE_CASE					)
			self.parent.assertEqual(result.last_hidden_state.shape			,						(self.batch_size, self.seq_length, self.hidden_size)					)

		def 				__lowerCamelCase				( self			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE					):
			__lowerCAmelCase     :		int		     = YosoForMaskedLM(config=_SCREAMING_SNAKE_CASE					)
			model.to(_SCREAMING_SNAKE_CASE					)
			model.eval()
			__lowerCAmelCase     :		Union[str, Any]		     = model(_SCREAMING_SNAKE_CASE			,						attention_mask=_SCREAMING_SNAKE_CASE			,						token_type_ids=_SCREAMING_SNAKE_CASE			,						labels=_SCREAMING_SNAKE_CASE					)
			self.parent.assertEqual(result.logits.shape			,						(self.batch_size, self.seq_length, self.vocab_size)					)

		def 				__lowerCamelCase				( self			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE					):
			__lowerCAmelCase     :		Optional[int]		     = YosoForQuestionAnswering(config=_SCREAMING_SNAKE_CASE					)
			model.to(_SCREAMING_SNAKE_CASE					)
			model.eval()
			__lowerCAmelCase     :		Dict		     = model(
			    _SCREAMING_SNAKE_CASE			,						attention_mask=_SCREAMING_SNAKE_CASE			,						token_type_ids=_SCREAMING_SNAKE_CASE			,						start_positions=_SCREAMING_SNAKE_CASE			,						end_positions=_SCREAMING_SNAKE_CASE			,						)
			self.parent.assertEqual(result.start_logits.shape			,						(self.batch_size, self.seq_length)					)
			self.parent.assertEqual(result.end_logits.shape			,						(self.batch_size, self.seq_length)					)

		def 				__lowerCamelCase				( self			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE					):
			__lowerCAmelCase     :		Tuple		     = self.num_labels
			__lowerCAmelCase     :		Optional[int]		     = YosoForSequenceClassification(_SCREAMING_SNAKE_CASE					)
			model.to(_SCREAMING_SNAKE_CASE					)
			model.eval()
			__lowerCAmelCase     :		Optional[Any]		     = model(_SCREAMING_SNAKE_CASE			,						attention_mask=_SCREAMING_SNAKE_CASE			,						token_type_ids=_SCREAMING_SNAKE_CASE			,						labels=_SCREAMING_SNAKE_CASE					)
			self.parent.assertEqual(result.logits.shape			,						(self.batch_size, self.num_labels)					)

		def 				__lowerCamelCase				( self			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE					):
			__lowerCAmelCase     :		Union[str, Any]		     = self.num_labels
			__lowerCAmelCase     :		Tuple		     = YosoForTokenClassification(config=_SCREAMING_SNAKE_CASE					)
			model.to(_SCREAMING_SNAKE_CASE					)
			model.eval()
			__lowerCAmelCase     :		Any		     = model(_SCREAMING_SNAKE_CASE			,						attention_mask=_SCREAMING_SNAKE_CASE			,						token_type_ids=_SCREAMING_SNAKE_CASE			,						labels=_SCREAMING_SNAKE_CASE					)
			self.parent.assertEqual(result.logits.shape			,						(self.batch_size, self.seq_length, self.num_labels)					)

		def 				__lowerCamelCase				( self			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE					):
			__lowerCAmelCase     :		Dict		     = self.num_choices
			__lowerCAmelCase     :		Tuple		     = YosoForMultipleChoice(config=_SCREAMING_SNAKE_CASE					)
			model.to(_SCREAMING_SNAKE_CASE					)
			model.eval()
			__lowerCAmelCase     :		List[str]		     = input_ids.unsqueeze(1					).expand(-1			,						self.num_choices			,						-1					).contiguous()
			__lowerCAmelCase     :		Optional[int]		     = token_type_ids.unsqueeze(1					).expand(-1			,						self.num_choices			,						-1					).contiguous()
			__lowerCAmelCase     :		Dict		     = input_mask.unsqueeze(1					).expand(-1			,						self.num_choices			,						-1					).contiguous()
			__lowerCAmelCase     :		Optional[Any]		     = model(
			    _SCREAMING_SNAKE_CASE			,						attention_mask=_SCREAMING_SNAKE_CASE			,						token_type_ids=_SCREAMING_SNAKE_CASE			,						labels=_SCREAMING_SNAKE_CASE			,						)
			self.parent.assertEqual(result.logits.shape			,						(self.batch_size, self.num_choices)					)







		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		Union[str, Any]		     = self.prepare_config_and_inputs()
			(
			    (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  (
			    __lowerCAmelCase
			)     ,  
			)     :		Union[str, Any]		     = config_and_inputs
			__lowerCAmelCase     :		List[str]		     = {'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
			return config, inputs_dict




@require_torch
class 					A__			(      _lowerCamelCase			,	_lowerCamelCase			,	unittest.TestCase):
		A_		:			Union[str, Any]							  =      (
		    (
		        YosoModel,
		        YosoForMaskedLM,
		        YosoForMultipleChoice,
		        YosoForQuestionAnswering,
		        YosoForSequenceClassification,
		        YosoForTokenClassification,
		    )
		    if is_torch_available()
		    else ()
		)
		A_		:			Tuple							  =      False
		A_		:			Optional[Any]							  =      False
		A_		:			Optional[int]							  =      False

		A_		:			List[str]							  =      ()
		A_		:			List[Any]							  =      (
		    {
		        'feature-extraction': YosoModel,
		        'fill-mask': YosoForMaskedLM,
		        'question-answering': YosoForQuestionAnswering,
		        'text-classification': YosoForSequenceClassification,
		        'token-classification': YosoForTokenClassification,
		        'zero-shot': YosoForSequenceClassification,
		    }
		    if is_torch_available()
		    else {}
		)

		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		Any		     = YosoModelTester(self					)
			__lowerCAmelCase     :		Optional[Any]		     = ConfigTester(self			,						config_class=_SCREAMING_SNAKE_CASE			,						hidden_size=37					)

		def 				__lowerCamelCase				( self					):
			self.config_tester.run_common_tests()

		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		List[Any]		     = self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_model(*_SCREAMING_SNAKE_CASE					)

		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		List[str]		     = self.model_tester.prepare_config_and_inputs()
			for type in ["absolute", "relative_key", "relative_key_query"]:
				__lowerCAmelCase     :		List[Any]		     = type
				self.model_tester.create_and_check_model(*_SCREAMING_SNAKE_CASE					)

		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		List[str]		     = self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_for_masked_lm(*_SCREAMING_SNAKE_CASE					)

		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		Dict		     = self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_for_multiple_choice(*_SCREAMING_SNAKE_CASE					)

		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		List[Any]		     = self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_for_question_answering(*_SCREAMING_SNAKE_CASE					)

		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		List[str]		     = self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_for_sequence_classification(*_SCREAMING_SNAKE_CASE					)

		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		Optional[int]		     = self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_for_token_classification(*_SCREAMING_SNAKE_CASE					)

		@slow
		def 				__lowerCamelCase				( self					):
			for model_name in YOSO_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
				__lowerCAmelCase     :		int		     = YosoModel.from_pretrained(_SCREAMING_SNAKE_CASE					)
				self.assertIsNotNone(_SCREAMING_SNAKE_CASE					)







		def 				__lowerCamelCase				( self					):
			return




@require_torch
class 					A__			(      unittest.TestCase):

		@slow
		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		List[str]		     = YosoModel.from_pretrained('uw-madison/yoso-4096'					)
			__lowerCAmelCase     :		Optional[Any]		     = torch.tensor([[0, 1, 2, 3, 4, 5]]					)

			with torch.no_grad():
				__lowerCAmelCase     :		Dict		     = model(_SCREAMING_SNAKE_CASE					)[0]

			__lowerCAmelCase     :		Union[str, Any]		     = torch.Size((1, 6, 7_68)					)
			self.assertEqual(output.shape			,						_SCREAMING_SNAKE_CASE					)

			__lowerCAmelCase     :		Tuple		     = torch.tensor(
			    [[[-0.0611, 0.1242, 0.0840], [0.0280, -0.0048, 0.1125], [0.0106, 0.0226, 0.0751]]]					)

			self.assertTrue(torch.allclose(output[:, :3, :3]			,						_SCREAMING_SNAKE_CASE			,						atol=1E-4					)					)

		@slow
		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		str		     = YosoForMaskedLM.from_pretrained('uw-madison/yoso-4096'					)
			__lowerCAmelCase     :		Optional[int]		     = torch.tensor([[0, 1, 2, 3, 4, 5]]					)

			with torch.no_grad():
				__lowerCAmelCase     :		Union[str, Any]		     = model(_SCREAMING_SNAKE_CASE					)[0]

			__lowerCAmelCase     :		Tuple		     = 5_02_65

			__lowerCAmelCase     :		str		     = torch.Size((1, 6, vocab_size)					)
			self.assertEqual(output.shape			,						_SCREAMING_SNAKE_CASE					)

			__lowerCAmelCase     :		List[str]		     = torch.tensor(
			    [[[-2.1313, -3.7285, -2.2407], [-2.7047, -3.3314, -2.6408], [0.0629, -2.5166, -0.3356]]]					)

			self.assertTrue(torch.allclose(output[:, :3, :3]			,						_SCREAMING_SNAKE_CASE			,						atol=1E-4					)					)







		@slow
		def 				__lowerCamelCase				( self					):
			__lowerCAmelCase     :		str		     = YosoForMaskedLM.from_pretrained('uw-madison/yoso-4096'					)
			__lowerCAmelCase     :		int		     = torch.arange(40_96					).unsqueeze(0					)

			with torch.no_grad():
				__lowerCAmelCase     :		Dict		     = model(_SCREAMING_SNAKE_CASE					)[0]

			__lowerCAmelCase     :		List[Any]		     = 5_02_65

			__lowerCAmelCase     :		Union[str, Any]		     = torch.Size((1, 40_96, vocab_size)					)
			self.assertEqual(output.shape			,						_SCREAMING_SNAKE_CASE					)

			__lowerCAmelCase     :		int		     = torch.tensor(
			    [[[-2.3914, -4.3742, -5.0956], [-4.0988, -4.2384, -7.0406], [-3.1427, -3.7192, -6.6800]]]					)

			self.assertTrue(torch.allclose(output[:, :3, :3]			,						_SCREAMING_SNAKE_CASE			,						atol=1E-4					)					)

"""simple docstring"""







from ..utils import (
    OptionalDependencyNotAvailable,
    is_flax_available,
    is_invisible_watermark_available,
    is_k_diffusion_available,
    is_librosa_available,
    is_note_seq_available,
    is_onnx_available,
    is_torch_available,
    is_transformers_available,
)


try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from ..utils.dummy_pt_objects import *  # noqa F403
else:
							from .consistency_models import ConsistencyModelPipeline
							from .dance_diffusion import DanceDiffusionPipeline
							from .ddim import DDIMPipeline
							from .ddpm import DDPMPipeline
							from .dit import DiTPipeline
							from .latent_diffusion import LDMSuperResolutionPipeline
							from .latent_diffusion_uncond import LDMPipeline
							from .pipeline_utils import AudioPipelineOutput, DiffusionPipeline, ImagePipelineOutput
							from .pndm import PNDMPipeline
							from .repaint import RePaintPipeline
							from .score_sde_ve import ScoreSdeVePipeline
							from .stochastic_karras_ve import KarrasVePipeline

try:
							if not (is_torch_available() and is_librosa_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from ..utils.dummy_torch_and_librosa_objects import *  # noqa F403
else:
							from .audio_diffusion import AudioDiffusionPipeline, Mel

try:
							if not (is_torch_available() and is_transformers_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from ..utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
							from .alt_diffusion import AltDiffusionImgaImgPipeline, AltDiffusionPipeline
							from .audioldm import AudioLDMPipeline
							from .controlnet import (
							    StableDiffusionControlNetImgaImgPipeline,
							    StableDiffusionControlNetInpaintPipeline,
							    StableDiffusionControlNetPipeline,
							)
							from .deepfloyd_if import (
							    IFImgaImgPipeline,
							    IFImgaImgSuperResolutionPipeline,
							    IFInpaintingPipeline,
							    IFInpaintingSuperResolutionPipeline,
							    IFPipeline,
							    IFSuperResolutionPipeline,
							)
							from .kandinsky import (
							    KandinskyImgaImgPipeline,
							    KandinskyInpaintPipeline,
							    KandinskyPipeline,
							    KandinskyPriorPipeline,
							)
							from .kandinskya_a import (
							    KandinskyVaaControlnetImgaImgPipeline,
							    KandinskyVaaControlnetPipeline,
							    KandinskyVaaImgaImgPipeline,
							    KandinskyVaaInpaintPipeline,
							    KandinskyVaaPipeline,
							    KandinskyVaaPriorEmbaEmbPipeline,
							    KandinskyVaaPriorPipeline,
							)
							from .latent_diffusion import LDMTextToImagePipeline
							from .paint_by_example import PaintByExamplePipeline
							from .semantic_stable_diffusion import SemanticStableDiffusionPipeline
							from .shap_e import ShapEImgaImgPipeline, ShapEPipeline
							from .stable_diffusion import (
							    CycleDiffusionPipeline,
							    StableDiffusionAttendAndExcitePipeline,
							    StableDiffusionDepthaImgPipeline,
							    StableDiffusionDiffEditPipeline,
							    StableDiffusionImageVariationPipeline,
							    StableDiffusionImgaImgPipeline,
							    StableDiffusionInpaintPipeline,
							    StableDiffusionInpaintPipelineLegacy,
							    StableDiffusionInstructPixaPixPipeline,
							    StableDiffusionLatentUpscalePipeline,
							    StableDiffusionLDMaDPipeline,
							    StableDiffusionModelEditingPipeline,
							    StableDiffusionPanoramaPipeline,
							    StableDiffusionParadigmsPipeline,
							    StableDiffusionPipeline,
							    StableDiffusionPixaPixZeroPipeline,
							    StableDiffusionSAGPipeline,
							    StableDiffusionUpscalePipeline,
							    StableUnCLIPImgaImgPipeline,
							    StableUnCLIPPipeline,
							)
							from .stable_diffusion_safe import StableDiffusionPipelineSafe
							from .text_to_video_synthesis import TextToVideoSDPipeline, TextToVideoZeroPipeline, VideoToVideoSDPipeline
							from .unclip import UnCLIPImageVariationPipeline, UnCLIPPipeline
							from .unidiffuser import ImageTextPipelineOutput, UniDiffuserModel, UniDiffuserPipeline, UniDiffuserTextDecoder
							from .versatile_diffusion import (
							    VersatileDiffusionDualGuidedPipeline,
							    VersatileDiffusionImageVariationPipeline,
							    VersatileDiffusionPipeline,
							    VersatileDiffusionTextToImagePipeline,
							)
							from .vq_diffusion import VQDiffusionPipeline


try:
							if not (is_torch_available() and is_transformers_available() and is_invisible_watermark_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from ..utils.dummy_torch_and_transformers_and_invisible_watermark_objects import *  # noqa F403
else:
							from .stable_diffusion_xl import StableDiffusionXLImgaImgPipeline, StableDiffusionXLPipeline

try:
							if not is_onnx_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from ..utils.dummy_onnx_objects import *  # noqa F403
else:
							from .onnx_utils import OnnxRuntimeModel

try:
							if not (is_torch_available() and is_transformers_available() and is_onnx_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from ..utils.dummy_torch_and_transformers_and_onnx_objects import *  # noqa F403
else:
							from .stable_diffusion import (
							    OnnxStableDiffusionImgaImgPipeline,
							    OnnxStableDiffusionInpaintPipeline,
							    OnnxStableDiffusionInpaintPipelineLegacy,
							    OnnxStableDiffusionPipeline,
							    OnnxStableDiffusionUpscalePipeline,
							    StableDiffusionOnnxPipeline,
							)

try:
							if not (is_torch_available() and is_transformers_available() and is_k_diffusion_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from ..utils.dummy_torch_and_transformers_and_k_diffusion_objects import *  # noqa F403
else:
							from .stable_diffusion import StableDiffusionKDiffusionPipeline

try:
							if not is_flax_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from ..utils.dummy_flax_objects import *  # noqa F403
else:
							from .pipeline_flax_utils import FlaxDiffusionPipeline


try:
							if not (is_flax_available() and is_transformers_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from ..utils.dummy_flax_and_transformers_objects import *  # noqa F403
else:
							from .controlnet import FlaxStableDiffusionControlNetPipeline
							from .stable_diffusion import (
							    FlaxStableDiffusionImgaImgPipeline,
							    FlaxStableDiffusionInpaintPipeline,
							    FlaxStableDiffusionPipeline,
							)
try:
							if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from ..utils.dummy_transformers_and_torch_and_note_seq_objects import *  # noqa F403
else:
							from .spectrogram_diffusion import MidiProcessor, SpectrogramDiffusionPipeline