






'''simple docstring'''





import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


__A				:				Optional[int]					=		logging.get_logger(__name__)
class 					lowercase							(				_lowerCamelCase   ):


    '''simple docstring'''

    lowerCAmelCase__   					=				"speech-encoder-decoder"
    lowerCAmelCase__   					=				True

    def __init__(       self  :  int					,  **__lowerCamelCase  :  Optional[Any]  )				->				List[str]:

     '''simple docstring'''




     super().__init__(**__lowerCamelCase  )
     if "encoder" not in kwargs or "decoder" not in kwargs:
      raise ValueError(
          f'''A configuraton of type {self.model_type} cannot be instantiated because not both `encoder` and'''
          f''' `decoder` sub-configurations are passed, but only {kwargs}'''  )

     lowerCamelCase__	=  kwargs.pop("encoder"  )
     lowerCamelCase__	=  encoder_config.pop("model_type"  )
     lowerCamelCase__	=  kwargs.pop("decoder"  )
     lowerCamelCase__	=  decoder_config.pop("model_type"  )

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

    @classmethod
    def  a__					(       cls  :  Tuple					,  __lowerCamelCase  :  PretrainedConfig					,  __lowerCamelCase  :  PretrainedConfig					,  **__lowerCamelCase  :  Optional[Any]  )				->				PretrainedConfig:

     '''simple docstring'''




     logger.info("Setting `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config"  )
     lowerCamelCase__	=  True
     lowerCamelCase__	=  True

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




    def  a__					(       self  :  Tuple  )				->				Optional[int]:

     '''simple docstring'''




     lowerCamelCase__	=  copy.deepcopy(self.__dict__  )
     lowerCamelCase__	=  self.encoder.to_dict()
     lowerCamelCase__	=  self.decoder.to_dict()
     lowerCamelCase__	=  self.__class__.model_type
     return output









'''simple docstring'''





from ..utils import DummyObject, requires_backends
class 					lowercase							(				metaclass=_lowerCamelCase   ):


    '''simple docstring'''

    lowerCAmelCase__   					=				["torch", "transformers", "invisible_watermark"]

    def __init__(       self  :  Optional[Any]					,  *__lowerCamelCase  :  List[Any]					,  **__lowerCamelCase  :  Union[str, Any]  )				->				Dict:

     '''simple docstring'''




     requires_backends(self					,  ["torch", "transformers", "invisible_watermark"]  )

    @classmethod
    def  a__					(       cls  :  Any					,  *__lowerCamelCase  :  List[Any]					,  **__lowerCamelCase  :  Tuple  )				->				List[str]:

     '''simple docstring'''




     requires_backends(cls					,  ["torch", "transformers", "invisible_watermark"]  )




    @classmethod
    def  a__					(       cls  :  Union[str, Any]					,  *__lowerCamelCase  :  Tuple					,  **__lowerCamelCase  :  Tuple  )				->				List[Any]:

     '''simple docstring'''




     requires_backends(cls					,  ["torch", "transformers", "invisible_watermark"]  )
class 					lowercase							(				metaclass=_lowerCamelCase   ):


    '''simple docstring'''

    lowerCAmelCase__   					=				["torch", "transformers", "invisible_watermark"]

    def __init__(       self  :  Optional[Any]					,  *__lowerCamelCase  :  str					,  **__lowerCamelCase  :  Optional[Any]  )				->				str:

     '''simple docstring'''




     requires_backends(self					,  ["torch", "transformers", "invisible_watermark"]  )

    @classmethod
    def  a__					(       cls  :  Union[str, Any]					,  *__lowerCamelCase  :  List[str]					,  **__lowerCamelCase  :  Dict  )				->				Any:

     '''simple docstring'''




     requires_backends(cls					,  ["torch", "transformers", "invisible_watermark"]  )




    @classmethod
    def  a__					(       cls  :  List[Any]					,  *__lowerCamelCase  :  Union[str, Any]					,  **__lowerCamelCase  :  Any  )				->				Any:

     '''simple docstring'''




     requires_backends(cls					,  ["torch", "transformers", "invisible_watermark"]  )

