






'''simple docstring'''

import unittest

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

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
      import torch

      from transformers import (
          XLMForMultipleChoice,
          XLMForQuestionAnswering,
          XLMForQuestionAnsweringSimple,
          XLMForSequenceClassification,
          XLMForTokenClassification,
          XLMModel,
          XLMWithLMHeadModel,
      )
      from transformers.models.xlm.modeling_xlm import XLM_PRETRAINED_MODEL_ARCHIVE_LIST




class      A     :






 """simple docstring"""





 def __init__(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase=13      ,  __lowerCAmelCase=7      ,  __lowerCAmelCase=True      ,  __lowerCAmelCase=True      ,  __lowerCAmelCase=True      ,  __lowerCAmelCase=True      ,  __lowerCAmelCase=True      ,  __lowerCAmelCase=False      ,  __lowerCAmelCase=False      ,  __lowerCAmelCase=False      ,  __lowerCAmelCase=2      ,  __lowerCAmelCase=99      ,  __lowerCAmelCase=0      ,  __lowerCAmelCase=32      ,  __lowerCAmelCase=5      ,  __lowerCAmelCase=4      ,  __lowerCAmelCase=0.1      ,  __lowerCAmelCase=0.1      ,  __lowerCAmelCase=5_12      ,  __lowerCAmelCase=2      ,  __lowerCAmelCase=0.02      ,  __lowerCAmelCase=2      ,  __lowerCAmelCase=4      ,  __lowerCAmelCase="last"      ,  __lowerCAmelCase=True      ,  __lowerCAmelCase=None      ,  __lowerCAmelCase=0      ,  ):
       UpperCamelCase_					: Any            =				parent
       UpperCamelCase_					: Optional[int]            =				batch_size
       UpperCamelCase_					: str            =				seq_length
       UpperCamelCase_					: List[str]            =				is_training
       UpperCamelCase_					: List[Any]            =				use_input_lengths
       UpperCamelCase_					: Optional[Any]            =				use_token_type_ids
       UpperCamelCase_					: Dict            =				use_labels
       UpperCamelCase_					: Optional[Any]            =				gelu_activation
       UpperCamelCase_					: Optional[Any]            =				sinusoidal_embeddings
       UpperCamelCase_					: List[Any]            =				causal
       UpperCamelCase_					: Optional[int]            =				asm
       UpperCamelCase_					: int            =				n_langs
       UpperCamelCase_					: str            =				vocab_size
       UpperCamelCase_					: Any            =				n_special
       UpperCamelCase_					: Tuple            =				hidden_size
       UpperCamelCase_					: Optional[int]            =				num_hidden_layers
       UpperCamelCase_					: Optional[Any]            =				num_attention_heads
       UpperCamelCase_					: Optional[Any]            =				hidden_dropout_prob
       UpperCamelCase_					: List[str]            =				attention_probs_dropout_prob
       UpperCamelCase_					: Dict            =				max_position_embeddings
       UpperCamelCase_					: List[str]            =				type_sequence_label_size
       UpperCamelCase_					: Optional[Any]            =				initializer_range
       UpperCamelCase_					: Any            =				num_labels
       UpperCamelCase_					: str            =				num_choices
       UpperCamelCase_					: List[Any]            =				summary_type
       UpperCamelCase_					: Dict            =				use_proj
       UpperCamelCase_					: List[Any]            =				scope
       UpperCamelCase_					: Dict            =				bos_token_id
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: List[Any]            =				ids_tensor([self.batch_size, self.seq_length]      ,  self.vocab_size			)
       UpperCamelCase_					: List[str]            =				random_attention_mask([self.batch_size, self.seq_length]			)

       UpperCamelCase_					: Dict            =				None
       if self.use_input_lengths:
             UpperCamelCase_					: Dict            =				(
                 ids_tensor([self.batch_size]      ,  vocab_size=2			) + self.seq_length - 2
             )  # small variation of seq_length

       UpperCamelCase_					: Tuple            =				None
       if self.use_token_type_ids:
             UpperCamelCase_					: Tuple            =				ids_tensor([self.batch_size, self.seq_length]      ,  self.n_langs			)

       UpperCamelCase_					: Optional[Any]            =				None
       UpperCamelCase_					: Optional[Any]            =				None
       UpperCamelCase_					: Dict            =				None
       if self.use_labels:
             UpperCamelCase_					: Optional[Any]            =				ids_tensor([self.batch_size]      ,  self.type_sequence_label_size			)
             UpperCamelCase_					: List[str]            =				ids_tensor([self.batch_size, self.seq_length]      ,  self.num_labels			)
             UpperCamelCase_					: Any            =				ids_tensor([self.batch_size]      ,  2			).float()
             UpperCamelCase_					: Optional[Any]            =				ids_tensor([self.batch_size]      ,  self.num_choices			)

       UpperCamelCase_					: Any            =				self.get_config()

       return (
           config,
           input_ids,
           token_type_ids,
           input_lengths,
           sequence_labels,
           token_labels,
           is_impossible_labels,
           choice_labels,
           input_mask,
       )
 def 	_UpperCAmelCase							(				self			):
       return XLMConfig(
           vocab_size=self.vocab_size      ,  n_special=self.n_special      ,  emb_dim=self.hidden_size      ,  n_layers=self.num_hidden_layers      ,  n_heads=self.num_attention_heads      ,  dropout=self.hidden_dropout_prob      ,  attention_dropout=self.attention_probs_dropout_prob      ,  gelu_activation=self.gelu_activation      ,  sinusoidal_embeddings=self.sinusoidal_embeddings      ,  asm=self.asm      ,  causal=self.causal      ,  n_langs=self.n_langs      ,  max_position_embeddings=self.max_position_embeddings      ,  initializer_range=self.initializer_range      ,  summary_type=self.summary_type      ,  use_proj=self.use_proj      ,  num_labels=self.num_labels      ,  bos_token_id=self.bos_token_id      ,  )
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  ):
       UpperCamelCase_					: Union[str, Any]            =				XLMModel(config=__lowerCAmelCase			)
       model.to(__lowerCAmelCase			)
       model.eval()
       UpperCamelCase_					: List[Any]            =				model(__lowerCAmelCase      ,  lengths=__lowerCAmelCase      ,  langs=__lowerCAmelCase			)
       UpperCamelCase_					: Dict            =				model(__lowerCAmelCase      ,  langs=__lowerCAmelCase			)
       UpperCamelCase_					: Dict            =				model(__lowerCAmelCase			)
       self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, self.seq_length, self.hidden_size)			)
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  ):
       UpperCamelCase_					: Optional[Any]            =				XLMWithLMHeadModel(__lowerCAmelCase			)
       model.to(__lowerCAmelCase			)
       model.eval()

       UpperCamelCase_					: str            =				model(__lowerCAmelCase      ,  token_type_ids=__lowerCAmelCase      ,  labels=__lowerCAmelCase			)
       self.parent.assertEqual(result.loss.shape      ,  ()			)
       self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.seq_length, self.vocab_size)			)
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  ):
       UpperCamelCase_					: Optional[int]            =				XLMForQuestionAnsweringSimple(__lowerCAmelCase			)
       model.to(__lowerCAmelCase			)
       model.eval()

       UpperCamelCase_					: Any            =				model(__lowerCAmelCase			)

       UpperCamelCase_					: Tuple            =				model(__lowerCAmelCase      ,  start_positions=__lowerCAmelCase      ,  end_positions=__lowerCAmelCase			)
       UpperCamelCase_					: int            =				outputs
       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 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  ):
       UpperCamelCase_					: Union[str, Any]            =				XLMForQuestionAnswering(__lowerCAmelCase			)
       model.to(__lowerCAmelCase			)
       model.eval()

       UpperCamelCase_					: List[Any]            =				model(__lowerCAmelCase			)

       UpperCamelCase_					: Dict            =				model(
           __lowerCAmelCase      ,  start_positions=__lowerCAmelCase      ,  end_positions=__lowerCAmelCase      ,  cls_index=__lowerCAmelCase      ,  is_impossible=__lowerCAmelCase      ,  p_mask=__lowerCAmelCase      ,  )

       UpperCamelCase_					: Optional[Any]            =				model(
           __lowerCAmelCase      ,  start_positions=__lowerCAmelCase      ,  end_positions=__lowerCAmelCase      ,  cls_index=__lowerCAmelCase      ,  is_impossible=__lowerCAmelCase      ,  )

       ((UpperCamelCase_)     ,      )					: str            =				result_with_labels.to_tuple()

       UpperCamelCase_					: int            =				model(__lowerCAmelCase      ,  start_positions=__lowerCAmelCase      ,  end_positions=__lowerCAmelCase			)

       ((UpperCamelCase_)     ,      )					: List[str]            =				result_with_labels.to_tuple()

       self.parent.assertEqual(result_with_labels.loss.shape      ,  ()			)
       self.parent.assertEqual(result.start_top_log_probs.shape      ,  (self.batch_size, model.config.start_n_top)			)
       self.parent.assertEqual(result.start_top_index.shape      ,  (self.batch_size, model.config.start_n_top)			)
       self.parent.assertEqual(
           result.end_top_log_probs.shape      ,  (self.batch_size, model.config.start_n_top * model.config.end_n_top)			)
       self.parent.assertEqual(
           result.end_top_index.shape      ,  (self.batch_size, model.config.start_n_top * model.config.end_n_top)			)
       self.parent.assertEqual(result.cls_logits.shape      ,  (self.batch_size,)			)
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  ):
       UpperCamelCase_					: List[Any]            =				XLMForSequenceClassification(__lowerCAmelCase			)
       model.to(__lowerCAmelCase			)
       model.eval()

       UpperCamelCase_					: Any            =				model(__lowerCAmelCase			)
       UpperCamelCase_					: Tuple            =				model(__lowerCAmelCase      ,  labels=__lowerCAmelCase			)
       self.parent.assertEqual(result.loss.shape      ,  ()			)
       self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.type_sequence_label_size)			)
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  ):
       UpperCamelCase_					: Tuple            =				self.num_labels
       UpperCamelCase_					: Any            =				XLMForTokenClassification(__lowerCAmelCase			)
       model.to(__lowerCAmelCase			)
       model.eval()

       UpperCamelCase_					: str            =				model(__lowerCAmelCase      ,  attention_mask=__lowerCAmelCase      ,  labels=__lowerCAmelCase			)
       self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.seq_length, self.num_labels)			)
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  ):
       UpperCamelCase_					: Any            =				self.num_choices
       UpperCamelCase_					: Optional[Any]            =				XLMForMultipleChoice(config=__lowerCAmelCase			)
       model.to(__lowerCAmelCase			)
       model.eval()
       UpperCamelCase_					: str            =				input_ids.unsqueeze(1			).expand(-1      ,  self.num_choices      ,  -1			).contiguous()
       UpperCamelCase_					: Tuple            =				token_type_ids.unsqueeze(1			).expand(-1      ,  self.num_choices      ,  -1			).contiguous()
       UpperCamelCase_					: Optional[Any]            =				input_mask.unsqueeze(1			).expand(-1      ,  self.num_choices      ,  -1			).contiguous()
       UpperCamelCase_					: int            =				model(
           __lowerCAmelCase      ,  attention_mask=__lowerCAmelCase      ,  token_type_ids=__lowerCAmelCase      ,  labels=__lowerCAmelCase      ,  )
       self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.num_choices)			)





 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: int            =				self.prepare_config_and_inputs()
       (
           (
           UpperCamelCase_
       )     ,      (
           UpperCamelCase_
       )     ,      (
           UpperCamelCase_
       )     ,      (
           UpperCamelCase_
       )     ,      (
           UpperCamelCase_
       )     ,      (
           UpperCamelCase_
       )     ,      (
           UpperCamelCase_
       )     ,      (
           UpperCamelCase_
       )     ,      (
           UpperCamelCase_
       )     ,      
       )					: List[Any]            =				config_and_inputs
       UpperCamelCase_					: List[Any]            =				{"""input_ids""": input_ids, """token_type_ids""": token_type_ids, """lengths""": input_lengths}
       return config, inputs_dict






@require_torch
class      A     (   SCREAMING_SNAKE_CASE__, SCREAMING_SNAKE_CASE__, SCREAMING_SNAKE_CASE__, unittest.TestCase    ):






 """simple docstring"""





 __a      :    str			  =    (
     (
         XLMModel,
         XLMWithLMHeadModel,
         XLMForQuestionAnswering,
         XLMForSequenceClassification,
         XLMForQuestionAnsweringSimple,
         XLMForTokenClassification,
         XLMForMultipleChoice,
     )
     if is_torch_available()
     else ()
 )
 __a      :    Optional[int]			  =    (
     (XLMWithLMHeadModel,) if is_torch_available() else ()
 )  # TODO (PVP): Check other models whether language generation is also applicable
 __a      :    List[Any]			  =    (
     {
         '''feature-extraction''': XLMModel,
         '''fill-mask''': XLMWithLMHeadModel,
         '''question-answering''': XLMForQuestionAnsweringSimple,
         '''text-classification''': XLMForSequenceClassification,
         '''text-generation''': XLMWithLMHeadModel,
         '''token-classification''': XLMForTokenClassification,
         '''zero-shot''': XLMForSequenceClassification,
     }
     if is_torch_available()
     else {}
 )
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase			):
       if (
           pipeline_test_casse_name == "QAPipelineTests"
           and tokenizer_name is not None
           and not tokenizer_name.endswith("""Fast"""			)
       ):
             # `QAPipelineTests` fails for a few models when the slower tokenizer are used.
             # (The slower tokenizers were never used for pipeline tests before the pipeline testing rework)
             # TODO: check (and possibly fix) the `QAPipelineTests` with slower tokenizer
             return True

       return False
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase=False			):
       UpperCamelCase_					: Optional[int]            =				super()._prepare_for_class(__lowerCAmelCase      ,  __lowerCAmelCase      ,  return_labels=__lowerCAmelCase			)

       if return_labels:
             if model_class.__name__ == "XLMForQuestionAnswering":
                   UpperCamelCase_					: Any            =				torch.zeros(
                       self.model_tester.batch_size      ,  dtype=torch.long      ,  device=__lowerCAmelCase			)
                   UpperCamelCase_					: Dict            =				torch.zeros(
                       self.model_tester.batch_size      ,  dtype=torch.long      ,  device=__lowerCAmelCase			)

       return inputs_dict
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: List[str]            =				XLMModelTester(self			)
       UpperCamelCase_					: Optional[Any]            =				ConfigTester(self      ,  config_class=__lowerCAmelCase      ,  emb_dim=37			)
 def 	_UpperCAmelCase							(				self			):
       self.config_tester.run_common_tests()
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: List[Any]            =				self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_xlm_model(*__lowerCAmelCase			)
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: Tuple            =				self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_xlm_lm_head(*__lowerCAmelCase			)
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: int            =				self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_xlm_simple_qa(*__lowerCAmelCase			)
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: Optional[int]            =				self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_xlm_qa(*__lowerCAmelCase			)
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: int            =				self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_xlm_sequence_classif(*__lowerCAmelCase			)
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: List[Any]            =				self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_xlm_token_classif(*__lowerCAmelCase			)
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: Any            =				self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_xlm_for_multiple_choice(*__lowerCAmelCase			)
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase=False      ,  __lowerCAmelCase=1			):
       self.assertIsInstance(__lowerCAmelCase      ,  __lowerCAmelCase			)
       self.assertListEqual(
           [isinstance(__lowerCAmelCase      ,  __lowerCAmelCase			) for iter_attentions in attentions]      ,  [True] * len(__lowerCAmelCase			)			)
       self.assertEqual(len(__lowerCAmelCase			)      ,  (max_length - min_length) * num_beam_groups			)

       for idx, iter_attentions in enumerate(__lowerCAmelCase			):
             # adds PAD dummy token
             UpperCamelCase_					: Tuple            =				min_length + idx + 1
             UpperCamelCase_					: Optional[int]            =				min_length + idx + 1

             UpperCamelCase_					: int            =				(
                 batch_size * num_beam_groups,
                 config.num_attention_heads,
                 tgt_len,
                 src_len,
             )
             # check attn size
             self.assertListEqual(
                 [layer_attention.shape for layer_attention in iter_attentions]      ,  [expected_shape] * len(__lowerCAmelCase			)			)
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase=False      ,  __lowerCAmelCase=1			):
       self.assertIsInstance(__lowerCAmelCase      ,  __lowerCAmelCase			)
       self.assertListEqual(
           [isinstance(__lowerCAmelCase      ,  __lowerCAmelCase			) for iter_hidden_states in hidden_states]      ,  [True] * len(__lowerCAmelCase			)      ,  )
       self.assertEqual(len(__lowerCAmelCase			)      ,  (max_length - min_length) * num_beam_groups			)

       for idx, iter_hidden_states in enumerate(__lowerCAmelCase			):
             # adds PAD dummy token
             UpperCamelCase_					: Optional[Any]            =				min_length + idx + 1
             UpperCamelCase_					: List[Any]            =				(batch_size * num_beam_groups, seq_len, config.hidden_size)
             # check hidden size
             self.assertListEqual(
                 [layer_hidden_states.shape for layer_hidden_states in iter_hidden_states]      ,  [expected_shape] * len(__lowerCAmelCase			)      ,  )
       pass





 @slow
 def 	_UpperCAmelCase							(				self			):
       for model_name in XLM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
             UpperCamelCase_					: Any            =				XLMModel.from_pretrained(__lowerCAmelCase			)
             self.assertIsNotNone(__lowerCAmelCase			)






@require_torch
class      A     (   unittest.TestCase    ):






 """simple docstring"""





 @slow
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: str            =				XLMWithLMHeadModel.from_pretrained("""xlm-mlm-en-2048"""			)
       model.to(__lowerCAmelCase			)
       UpperCamelCase_					: str            =				torch.tensor([[14, 4_47]]      ,  dtype=torch.long      ,  device=__lowerCAmelCase			)  # the president
       UpperCamelCase_					: Tuple            =				[
           14,
           4_47,
           14,
           4_47,
           14,
           4_47,
           14,
           4_47,
           14,
           4_47,
           14,
           4_47,
           14,
           4_47,
           14,
           4_47,
           14,
           4_47,
           14,
           4_47,
       ]  # the president the president the president the president the president the president the president the president the president the president
       # TODO(PVP): this and other input_ids I tried for generation give pretty bad results. Not sure why. Model might just not be made for auto-regressive inference
       UpperCamelCase_					: Dict            =				model.generate(__lowerCAmelCase      ,  do_sample=__lowerCAmelCase			)
       self.assertListEqual(output_ids[0].cpu().numpy().tolist()      ,  __lowerCAmelCase			)














'''simple docstring'''

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


try:
      if not (is_transformers_available() and is_torch_available()):
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      from ...utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
      from .multicontrolnet import MultiControlNetModel
      from .pipeline_controlnet import StableDiffusionControlNetPipeline
      from .pipeline_controlnet_imgaimg import StableDiffusionControlNetImgaImgPipeline
      from .pipeline_controlnet_inpaint import StableDiffusionControlNetInpaintPipeline


if is_transformers_available() and is_flax_available():
      from .pipeline_flax_controlnet import FlaxStableDiffusionControlNetPipeline






