




import inspect
import unittest

from transformers import MobileViTConfig
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

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


if is_torch_available():
					import torch

					from transformers import MobileViTForImageClassification, MobileViTForSemanticSegmentation, MobileViTModel
					from transformers.models.mobilevit.modeling_mobilevit import MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
					from PIL import Image

					from transformers import MobileViTImageProcessor
class       a__   ( snake_case__				):






			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								__lowerCAmelCase           =	self.config_class(**self.inputs_dict      )
								self.parent.assertTrue(hasattr(_A		,      "hidden_sizes"      )      )
								self.parent.assertTrue(hasattr(_A		,      "neck_hidden_sizes"      )      )
								self.parent.assertTrue(hasattr(_A		,      "num_attention_heads"      )      )






class       a__   :






			def __init__(       self		,      _A		,      _A=1_3		,      _A=3_2		,      _A=2		,      _A=3		,      _A=6_4_0		,      _A=4		,      _A="silu"		,      _A=3		,      _A=3_2		,      _A=0.1		,      _A=0.1		,      _A=0.1		,      _A=0.02		,      _A=True		,      _A=True		,      _A=1_0		,      _A=None		,      ):




								"""simple docstring"""



								__lowerCAmelCase           =	parent
								__lowerCAmelCase           =	batch_size
								__lowerCAmelCase           =	image_size
								__lowerCAmelCase           =	patch_size
								__lowerCAmelCase           =	num_channels
								__lowerCAmelCase           =	last_hidden_size
								__lowerCAmelCase           =	num_attention_heads
								__lowerCAmelCase           =	hidden_act
								__lowerCAmelCase           =	conv_kernel_size
								__lowerCAmelCase           =	output_stride
								__lowerCAmelCase           =	hidden_dropout_prob
								__lowerCAmelCase           =	attention_probs_dropout_prob
								__lowerCAmelCase           =	classifier_dropout_prob
								__lowerCAmelCase           =	use_labels
								__lowerCAmelCase           =	is_training
								__lowerCAmelCase           =	num_labels
								__lowerCAmelCase           =	initializer_range
								__lowerCAmelCase           =	scope






			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								__lowerCAmelCase           =	floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]      )

								__lowerCAmelCase           =	None
								__lowerCAmelCase           =	None
								if self.use_labels:
													__lowerCAmelCase           =	ids_tensor([self.batch_size]		,      self.num_labels      )
													__lowerCAmelCase           =	ids_tensor([self.batch_size, self.image_size, self.image_size]		,      self.num_labels      )

								__lowerCAmelCase           =	self.get_config()

								return config, pixel_values, labels, pixel_labels






			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								return MobileViTConfig(
								    image_size=self.image_size		,      patch_size=self.patch_size		,      num_channels=self.num_channels		,      num_attention_heads=self.num_attention_heads		,      hidden_act=self.hidden_act		,      conv_kernel_size=self.conv_kernel_size		,      output_stride=self.output_stride		,      hidden_dropout_prob=self.hidden_dropout_prob		,      attention_probs_dropout_prob=self.attention_probs_dropout_prob		,      classifier_dropout_prob=self.classifier_dropout_prob		,      initializer_range=self.initializer_range		,      )






			def     __SCREAMING_SNAKE_CASE(       self		,      _A		,      _A		,      _A		,      _A      ):




								"""simple docstring"""



								__lowerCAmelCase           =	MobileViTModel(config=_A      )
								model.to(_A      )
								model.eval()
								__lowerCAmelCase           =	model(_A      )
								self.parent.assertEqual(
								    result.last_hidden_state.shape		,      (
								        self.batch_size,
								        self.last_hidden_size,
								        self.image_size // self.output_stride,
								        self.image_size // self.output_stride,
								    )		,      )






			def     __SCREAMING_SNAKE_CASE(       self		,      _A		,      _A		,      _A		,      _A      ):




								"""simple docstring"""



								__lowerCAmelCase           =	self.num_labels
								__lowerCAmelCase           =	MobileViTForImageClassification(_A      )
								model.to(_A      )
								model.eval()
								__lowerCAmelCase           =	model(_A		,      labels=_A      )
								self.parent.assertEqual(result.logits.shape		,      (self.batch_size, self.num_labels)      )






			def     __SCREAMING_SNAKE_CASE(       self		,      _A		,      _A		,      _A		,      _A      ):




								"""simple docstring"""



								__lowerCAmelCase           =	self.num_labels
								__lowerCAmelCase           =	MobileViTForSemanticSegmentation(_A      )
								model.to(_A      )
								model.eval()
								__lowerCAmelCase           =	model(_A      )
								self.parent.assertEqual(
								    result.logits.shape		,      (
								        self.batch_size,
								        self.num_labels,
								        self.image_size // self.output_stride,
								        self.image_size // self.output_stride,
								    )		,      )
								__lowerCAmelCase           =	model(_A		,      labels=_A      )
								self.parent.assertEqual(
								    result.logits.shape		,      (
								        self.batch_size,
								        self.num_labels,
								        self.image_size // self.output_stride,
								        self.image_size // self.output_stride,
								    )		,      )






			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								__lowerCAmelCase           =	self.prepare_config_and_inputs()
								__lowerCAmelCase       ,							__lowerCAmelCase       ,							__lowerCAmelCase       ,							__lowerCAmelCase           =	config_and_inputs
								__lowerCAmelCase           =	{"pixel_values": pixel_values}
								return config, inputs_dict






@require_torch
class       a__   ( snake_case__			,    snake_case__			,    unittest.TestCase				):
			_a							:   Any =   (
			    (MobileViTModel, MobileViTForImageClassification, MobileViTForSemanticSegmentation)
			    if is_torch_available()
			    else ()
			)
			_a							:   Union[str, Any] =   (
			    {
			        """feature-extraction""": MobileViTModel,
			        """image-classification""": MobileViTForImageClassification,
			        """image-segmentation""": MobileViTForSemanticSegmentation,
			    }
			    if is_torch_available()
			    else {}
			)

			_a							:   int =   False
			_a							:   Union[str, Any] =   False
			_a							:   List[str] =   False
			_a							:   Dict =   False






			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								__lowerCAmelCase           =	MobileViTModelTester(self      )
								__lowerCAmelCase           =	MobileViTConfigTester(self		,      config_class=_A		,      has_text_modality=_A      )






			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								self.config_tester.run_common_tests()






			@unittest.skip(reason="MobileViT does not use inputs_embeds"      )
			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								pass






			@unittest.skip(reason="MobileViT does not support input and output embeddings"      )
			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								pass






			@unittest.skip(reason="MobileViT does not output attentions"      )
			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								pass






			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								__lowerCAmelCase       ,							__lowerCAmelCase           =	self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
													__lowerCAmelCase           =	model_class(_A      )
													__lowerCAmelCase           =	inspect.signature(model.forward      )
													# signature.parameters is an OrderedDict => so arg_names order is deterministic
													__lowerCAmelCase           =	[*signature.parameters.keys()]

													__lowerCAmelCase           =	["pixel_values"]
													self.assertListEqual(arg_names[:1]		,      _A      )






			@unittest.skip("Will be fixed soon by reducing the size of the model used for common tests."      )
			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								pass






			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								__lowerCAmelCase           =	self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_model(*_A      )






			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								def check_hidden_states_output(_A		,      _A		,      _A      ):
													__lowerCAmelCase           =	model_class(_A      )
													model.to(_A      )
													model.eval()

													with torch.no_grad():
																		__lowerCAmelCase           =	model(**self._prepare_for_class(_A		,      _A      )      )

													__lowerCAmelCase           =	outputs.hidden_states

													__lowerCAmelCase           =	5
													self.assertEqual(len(_A      )		,      _A      )

													# MobileViT's feature maps are of shape (batch_size, num_channels, height, width)
													# with the width and height being successively divided by 2.
													__lowerCAmelCase           =	2
													for i in range(len(_A      )      ):
																		self.assertListEqual(
																		    list(hidden_states[i].shape[-2:]      )		,      [self.model_tester.image_size // divisor, self.model_tester.image_size // divisor]		,      )
																		divisor *= 2

													self.assertEqual(self.model_tester.output_stride		,      divisor // 2      )

								__lowerCAmelCase       ,							__lowerCAmelCase           =	self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
													__lowerCAmelCase           =	True
													check_hidden_states_output(_A		,      _A		,      _A      )

													# check that output_hidden_states also work using config
													del inputs_dict["output_hidden_states"]
													__lowerCAmelCase           =	True

													check_hidden_states_output(_A		,      _A		,      _A      )






			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								__lowerCAmelCase           =	self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_image_classification(*_A      )






			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								__lowerCAmelCase           =	self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_semantic_segmentation(*_A      )






			@slow
			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								for model_name in MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
													__lowerCAmelCase           =	MobileViTModel.from_pretrained(_A      )
													self.assertIsNotNone(_A      )







def      _a				(						):
					__lowerCAmelCase           =	Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"					)
					return image


@require_torch
@require_vision
class       a__   ( unittest.TestCase				):






			@cached_property
			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								return MobileViTImageProcessor.from_pretrained("apple/mobilevit-xx-small"      ) if is_vision_available() else None






			@slow
			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								__lowerCAmelCase           =	MobileViTForImageClassification.from_pretrained("apple/mobilevit-xx-small"      ).to(_A      )

								__lowerCAmelCase           =	self.default_image_processor
								__lowerCAmelCase           =	prepare_img()
								__lowerCAmelCase           =	image_processor(images=_A		,      return_tensors="pt"      ).to(_A      )

								# forward pass
								with torch.no_grad():
													__lowerCAmelCase           =	model(**_A      )

								# verify the logits
								__lowerCAmelCase           =	torch.Size((1, 1_0_0_0)      )
								self.assertEqual(outputs.logits.shape		,      _A      )

								__lowerCAmelCase           =	torch.tensor([-1.93_64, -1.23_27, -0.46_53]      ).to(_A      )

								self.assertTrue(torch.allclose(outputs.logits[0, :3]		,      _A		,      atol=1E-4      )      )






			@slow
			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								__lowerCAmelCase           =	MobileViTForSemanticSegmentation.from_pretrained("apple/deeplabv3-mobilevit-xx-small"      )
								__lowerCAmelCase           =	model.to(_A      )

								__lowerCAmelCase           =	MobileViTImageProcessor.from_pretrained("apple/deeplabv3-mobilevit-xx-small"      )

								__lowerCAmelCase           =	prepare_img()
								__lowerCAmelCase           =	image_processor(images=_A		,      return_tensors="pt"      ).to(_A      )

								# forward pass
								with torch.no_grad():
													__lowerCAmelCase           =	model(**_A      )
								__lowerCAmelCase           =	outputs.logits

								# verify the logits
								__lowerCAmelCase           =	torch.Size((1, 2_1, 3_2, 3_2)      )
								self.assertEqual(logits.shape		,      _A      )

								__lowerCAmelCase           =	torch.tensor(
								    [
								        [[6.97_13, 6.97_86, 7.24_22], [7.28_93, 7.28_25, 7.44_46], [7.65_80, 7.87_97, 7.94_20]],
								        [[-10.68_69, -10.32_50, -10.34_71], [-10.42_28, -9.98_68, -9.71_32], [-11.04_05, -11.02_21, -10.73_18]],
								        [[-3.30_89, -2.85_39, -2.67_40], [-3.27_06, -2.56_21, -2.51_08], [-3.25_34, -2.66_15, -2.66_51]],
								    ]		,      device=_A		,      )

								self.assertTrue(torch.allclose(logits[0, :3, :3, :3]		,      _A		,      atol=1E-4      )      )






			@slow
			def     __SCREAMING_SNAKE_CASE(       self      ):




								"""simple docstring"""



								__lowerCAmelCase           =	MobileViTForSemanticSegmentation.from_pretrained("apple/deeplabv3-mobilevit-xx-small"      )
								__lowerCAmelCase           =	model.to(_A      )

								__lowerCAmelCase           =	MobileViTImageProcessor.from_pretrained("apple/deeplabv3-mobilevit-xx-small"      )

								__lowerCAmelCase           =	prepare_img()
								__lowerCAmelCase           =	image_processor(images=_A		,      return_tensors="pt"      ).to(_A      )

								# forward pass
								with torch.no_grad():
													__lowerCAmelCase           =	model(**_A      )

								__lowerCAmelCase           =	outputs.logits.detach().cpu()

								__lowerCAmelCase           =	image_processor.post_process_semantic_segmentation(outputs=_A		,      target_sizes=[(5_0, 6_0)]      )
								__lowerCAmelCase           =	torch.Size((5_0, 6_0)      )
								self.assertEqual(segmentation[0].shape		,      _A      )

								__lowerCAmelCase           =	image_processor.post_process_semantic_segmentation(outputs=_A      )
								__lowerCAmelCase           =	torch.Size((3_2, 3_2)      )
								self.assertEqual(segmentation[0].shape		,      _A      )










UpperCamelCase__         =      """0.18.2"""

from .configuration_utils import ConfigMixin
from .utils import (
    OptionalDependencyNotAvailable,
    is_flax_available,
    is_inflect_available,
    is_invisible_watermark_available,
    is_k_diffusion_available,
    is_k_diffusion_version,
    is_librosa_available,
    is_note_seq_available,
    is_onnx_available,
    is_scipy_available,
    is_torch_available,
    is_torchsde_available,
    is_transformers_available,
    is_transformers_version,
    is_unidecode_available,
    logging,
)


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

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					from .utils.dummy_pt_objects import *  # noqa F403
else:
					from .models import (
					    AutoencoderKL,
					    ControlNetModel,
					    ModelMixin,
					    PriorTransformer,
					    TaFilmDecoder,
					    TransformeraDModel,
					    UNetaDModel,
					    UNetaDConditionModel,
					    UNetaDModel,
					    UNetaDConditionModel,
					    VQModel,
					)
					from .optimization import (
					    get_constant_schedule,
					    get_constant_schedule_with_warmup,
					    get_cosine_schedule_with_warmup,
					    get_cosine_with_hard_restarts_schedule_with_warmup,
					    get_linear_schedule_with_warmup,
					    get_polynomial_decay_schedule_with_warmup,
					    get_scheduler,
					)
					from .pipelines import (
					    AudioPipelineOutput,
					    ConsistencyModelPipeline,
					    DanceDiffusionPipeline,
					    DDIMPipeline,
					    DDPMPipeline,
					    DiffusionPipeline,
					    DiTPipeline,
					    ImagePipelineOutput,
					    KarrasVePipeline,
					    LDMPipeline,
					    LDMSuperResolutionPipeline,
					    PNDMPipeline,
					    RePaintPipeline,
					    ScoreSdeVePipeline,
					)
					from .schedulers import (
					    CMStochasticIterativeScheduler,
					    DDIMInverseScheduler,
					    DDIMParallelScheduler,
					    DDIMScheduler,
					    DDPMParallelScheduler,
					    DDPMScheduler,
					    DEISMultistepScheduler,
					    DPMSolverMultistepInverseScheduler,
					    DPMSolverMultistepScheduler,
					    DPMSolverSinglestepScheduler,
					    EulerAncestralDiscreteScheduler,
					    EulerDiscreteScheduler,
					    HeunDiscreteScheduler,
					    IPNDMScheduler,
					    KarrasVeScheduler,
					    KDPMaAncestralDiscreteScheduler,
					    KDPMaDiscreteScheduler,
					    PNDMScheduler,
					    RePaintScheduler,
					    SchedulerMixin,
					    ScoreSdeVeScheduler,
					    UnCLIPScheduler,
					    UniPCMultistepScheduler,
					    VQDiffusionScheduler,
					)
					from .training_utils import EMAModel

try:
					if not (is_torch_available() and is_scipy_available()):
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					from .utils.dummy_torch_and_scipy_objects import *  # noqa F403
else:
					from .schedulers import LMSDiscreteScheduler

try:
					if not (is_torch_available() and is_torchsde_available()):
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					from .utils.dummy_torch_and_torchsde_objects import *  # noqa F403
else:
					from .schedulers import DPMSolverSDEScheduler

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 .pipelines import (
					    AltDiffusionImgaImgPipeline,
					    AltDiffusionPipeline,
					    AudioLDMPipeline,
					    CycleDiffusionPipeline,
					    IFImgaImgPipeline,
					    IFImgaImgSuperResolutionPipeline,
					    IFInpaintingPipeline,
					    IFInpaintingSuperResolutionPipeline,
					    IFPipeline,
					    IFSuperResolutionPipeline,
					    ImageTextPipelineOutput,
					    KandinskyImgaImgPipeline,
					    KandinskyInpaintPipeline,
					    KandinskyPipeline,
					    KandinskyPriorPipeline,
					    KandinskyVaaControlnetImgaImgPipeline,
					    KandinskyVaaControlnetPipeline,
					    KandinskyVaaImgaImgPipeline,
					    KandinskyVaaInpaintPipeline,
					    KandinskyVaaPipeline,
					    KandinskyVaaPriorEmbaEmbPipeline,
					    KandinskyVaaPriorPipeline,
					    LDMTextToImagePipeline,
					    PaintByExamplePipeline,
					    SemanticStableDiffusionPipeline,
					    ShapEImgaImgPipeline,
					    ShapEPipeline,
					    StableDiffusionAttendAndExcitePipeline,
					    StableDiffusionControlNetImgaImgPipeline,
					    StableDiffusionControlNetInpaintPipeline,
					    StableDiffusionControlNetPipeline,
					    StableDiffusionDepthaImgPipeline,
					    StableDiffusionDiffEditPipeline,
					    StableDiffusionImageVariationPipeline,
					    StableDiffusionImgaImgPipeline,
					    StableDiffusionInpaintPipeline,
					    StableDiffusionInpaintPipelineLegacy,
					    StableDiffusionInstructPixaPixPipeline,
					    StableDiffusionLatentUpscalePipeline,
					    StableDiffusionLDMaDPipeline,
					    StableDiffusionModelEditingPipeline,
					    StableDiffusionPanoramaPipeline,
					    StableDiffusionParadigmsPipeline,
					    StableDiffusionPipeline,
					    StableDiffusionPipelineSafe,
					    StableDiffusionPixaPixZeroPipeline,
					    StableDiffusionSAGPipeline,
					    StableDiffusionUpscalePipeline,
					    StableUnCLIPImgaImgPipeline,
					    StableUnCLIPPipeline,
					    TextToVideoSDPipeline,
					    TextToVideoZeroPipeline,
					    UnCLIPImageVariationPipeline,
					    UnCLIPPipeline,
					    UniDiffuserModel,
					    UniDiffuserPipeline,
					    UniDiffuserTextDecoder,
					    VersatileDiffusionDualGuidedPipeline,
					    VersatileDiffusionImageVariationPipeline,
					    VersatileDiffusionPipeline,
					    VersatileDiffusionTextToImagePipeline,
					    VideoToVideoSDPipeline,
					    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 .pipelines import StableDiffusionXLImgaImgPipeline, StableDiffusionXLPipeline

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 .pipelines import StableDiffusionKDiffusionPipeline

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 .pipelines import (
					    OnnxStableDiffusionImgaImgPipeline,
					    OnnxStableDiffusionInpaintPipeline,
					    OnnxStableDiffusionInpaintPipelineLegacy,
					    OnnxStableDiffusionPipeline,
					    OnnxStableDiffusionUpscalePipeline,
					    StableDiffusionOnnxPipeline,
					)

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 .pipelines import AudioDiffusionPipeline, Mel

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 .pipelines import SpectrogramDiffusionPipeline

try:
					if not is_flax_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					from .utils.dummy_flax_objects import *  # noqa F403
else:
					from .models.controlnet_flax import FlaxControlNetModel
					from .models.modeling_flax_utils import FlaxModelMixin
					from .models.unet_ad_condition_flax import FlaxUNetaDConditionModel
					from .models.vae_flax import FlaxAutoencoderKL
					from .pipelines import FlaxDiffusionPipeline
					from .schedulers import (
					    FlaxDDIMScheduler,
					    FlaxDDPMScheduler,
					    FlaxDPMSolverMultistepScheduler,
					    FlaxKarrasVeScheduler,
					    FlaxLMSDiscreteScheduler,
					    FlaxPNDMScheduler,
					    FlaxSchedulerMixin,
					    FlaxScoreSdeVeScheduler,
					)


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 .pipelines import (
					    FlaxStableDiffusionControlNetPipeline,
					    FlaxStableDiffusionImgaImgPipeline,
					    FlaxStableDiffusionInpaintPipeline,
					    FlaxStableDiffusionPipeline,
					)

try:
					if not (is_note_seq_available()):
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					from .utils.dummy_note_seq_objects import *  # noqa F403
else:
					from .pipelines import MidiProcessor




