class_docstr: [`EncoderDecoderConfig`] is the configuration class to store the configuration of a [`EncoderDecoderModel`]. It is
  used to instantiate an Encoder Decoder model according to the specified arguments, defining the encoder and decoder
  configs.
  
  Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
  documentation from [`PretrainedConfig`] for more information.
  
  Args:
      kwargs (*optional*):
          Dictionary of keyword arguments. Notably:
  
              - **encoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that defines
                the encoder config.
              - **decoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that defines
                the decoder config.
  
  Examples:
  
  ```python
  >>> from transformers import BertConfig, EncoderDecoderConfig, EncoderDecoderModel
  
  >>> # Initializing a BERT bert-base-uncased style configuration
  >>> config_encoder = BertConfig()
  >>> config_decoder = BertConfig()
  
  >>> config = EncoderDecoderConfig.from_encoder_decoder_configs(config_encoder, config_decoder)
  
  >>> # Initializing a Bert2Bert model from the bert-base-uncased style configurations
  >>> model = EncoderDecoderModel(config=config)
  
  >>> # Accessing the model configuration
  >>> config_encoder = model.config.encoder
  >>> config_decoder = model.config.decoder
  >>> # set decoder config to causal lm
  >>> config_decoder.is_decoder = True
  >>> config_decoder.add_cross_attention = True
  
  >>> # Saving the model, including its configuration
  >>> model.save_pretrained("my-model")
  
  >>> # loading model and config from pretrained folder
  >>> encoder_decoder_config = EncoderDecoderConfig.from_pretrained("my-model")
  >>> model = EncoderDecoderModel.from_pretrained("my-model", config=encoder_decoder_config)
  ```
code: def __init__(self, **kwargs):
      super().__init__(**kwargs)
      assert (
          "encoder" in kwargs and "decoder" in kwargs
      ), "Config has to be initialized with encoder and decoder config"
      encoder_config = kwargs.pop("encoder")
      encoder_model_type = encoder_config.pop("model_type")
      decoder_config = kwargs.pop("decoder")
      decoder_model_type = decoder_config.pop("model_type")
  
      from ..auto.configuration_auto import AutoConfig
  
      self.encoder = AutoConfig.for_model(
          encoder_model_type, **encoder_config
      )
      self.decoder = AutoConfig.for_model(
          decoder_model_type, **decoder_config
      )
      self.is_encoder_decoder = True
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/encoder_decoder/configuration_encoder_decoder.py
imports: import copy
  from ...configuration_utils import PretrainedConfig
  from ...utils import logging
label_desc: Use image node_id 1 to create a new EncoderDecoderConfig object from inherited base classes: PretrainedConfig with example: obj = EncoderDecoderConfig()