"""simple docstring"""






import copy

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


lowerCAmelCase__						:						Any		  =			logging.get_logger(__name__)
class        snake_case (				__UpperCAmelCase       ):




					"""simple docstring"""

					snake_case__       					=				"encoder-decoder"
					snake_case__       					=				True







					def __init__(       self     :			str					,**lowerCamelCase__     :			Any    ):
									super().__init__(**lowerCamelCase__    )
									assert (
									    "encoder" in kwargs and "decoder" in kwargs
									), "Config has to be initialized with encoder and decoder config"
									UpperCAmelCase__    =							kwargs.pop('encoder'    )
									UpperCAmelCase__    =							encoder_config.pop('model_type'    )
									UpperCAmelCase__    =							kwargs.pop('decoder'    )
									UpperCAmelCase__    =							decoder_config.pop('model_type'    )

									from ..auto.configuration_auto import AutoConfig

									UpperCAmelCase__    =							AutoConfig.for_model(lowerCamelCase__					,**lowerCamelCase__    )
									UpperCAmelCase__    =							AutoConfig.for_model(lowerCamelCase__					,**lowerCamelCase__    )
									UpperCAmelCase__    =							True







					@classmethod
					def 	__lowerCAmelCase		(       cls     :			List[str]					,lowerCamelCase__     :			PretrainedConfig					,lowerCamelCase__     :			PretrainedConfig					,**lowerCamelCase__     :			Dict    ):
									logger.info('Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config'    )
									UpperCAmelCase__    =							True
									UpperCAmelCase__    =							True

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







					def 	__lowerCAmelCase		(       self     :			Optional[Any]    ):
									UpperCAmelCase__    =							copy.deepcopy(self.__dict__    )
									UpperCAmelCase__    =							self.encoder.to_dict()
									UpperCAmelCase__    =							self.decoder.to_dict()
									UpperCAmelCase__    =							self.__class__.model_type
									return output




"""simple docstring"""






import warnings
from functools import wraps
from typing import Callable



def 						a_		(      lowerCamelCase ):

				@wraps(lowerCamelCase )
				def _inner_fn(*lowerCamelCase      ,    **lowerCamelCase ):
								warnings.warn(
								    (f'''\'{fn.__name__}\' is experimental and might be subject to breaking changes in the future.''')      ,    lowerCamelCase      ,    )
								return fn(*lowerCamelCase      ,    **lowerCamelCase )

				return _inner_fn



