



'''simple docstring'''
import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCamelCase__ =			logging.get_logger(__name__)


class        _UpperCAmelCase						(		_A			):
    __lowerCamelCase:   str		       =    'encoder-decoder'
    __lowerCamelCase:   Any		       =    True




    def __init__(			self  :       Dict  ,     **a  :       List[Any]			):






       '''simple docstring'''






       super().__init__(**__lowerCamelCase			)
       assert (
           "encoder" in kwargs and "decoder" in kwargs
       ), "Config has to be initialized with encoder and decoder config"
       lowercase_	:    List[Any]           =     kwargs.pop("encoder"			)
       lowercase_	:    List[Any]           =     encoder_config.pop("model_type"			)
       lowercase_	:    Optional[int]           =     kwargs.pop("decoder"			)
       lowercase_	:    Optional[int]           =     decoder_config.pop("model_type"			)

       from ..auto.configuration_auto import AutoConfig

       lowercase_	:    int           =     AutoConfig.for_model(__lowerCamelCase  ,     **__lowerCamelCase			)
       lowercase_	:    str           =     AutoConfig.for_model(__lowerCamelCase  ,     **__lowerCamelCase			)
       lowercase_	:    int           =     True




    @classmethod
    def 				lowerCAmelCase__				(			cls  :       List[str]  ,     a  :       PretrainedConfig  ,     a  :       PretrainedConfig  ,     **a  :       List[Any]			):






       '''simple docstring'''






       logger.info("Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config"			)
       lowercase_	:    Optional[int]           =     True
       lowercase_	:    Union[str, Any]           =     True

       return cls(encoder=encoder_config.to_dict()  ,     decoder=decoder_config.to_dict()  ,     **__lowerCamelCase			)





    def 				lowerCAmelCase__				(			self  :       Optional[Any]			):






       '''simple docstring'''






       lowercase_	:    List[str]           =     copy.deepcopy(self.__dict__			)
       lowercase_	:    List[Any]           =     self.encoder.to_dict()
       lowercase_	:    Union[str, Any]           =     self.decoder.to_dict()
       lowercase_	:    Dict           =     self.__class__.model_type
       return output












'''simple docstring'''
# limitations under the License.

# NOTE: This file is deprecated and will be removed in a future version.
# It only exists so that temporarely `from diffusers.pipelines import DiffusionPipeline` works

from .pipelines import DiffusionPipeline, ImagePipelineOutput  # noqa: F401
from .utils import deprecate


deprecate(
    'pipelines_utils',
    '0.22.0',
    'Importing `DiffusionPipeline` or `ImagePipelineOutput` from diffusers.pipeline_utils is deprecated. Please import from diffusers.pipelines.pipeline_utils instead.',
    standard_warn=False,
    stacklevel=3,
)




