class_docstr: Handles decoder-based text architectures.
class_docstr_tok: ["Handles","decoder-based","text","architectures","."]
code: def post_process_exported_models(
      self,
      path: Path,
      models_and_onnx_configs: Dict[
          str,
          Tuple[
              Union[
                  "PreTrainedModel", "TFPreTrainedModel", "ModelMixin"
              ],
              "OnnxConfig",
          ],
      ],
      onnx_files_subpaths: List[str],
  ):
      (
          models_and_onnx_configs,
          onnx_files_subpaths,
      ) = super().post_process_exported_models(
          path, models_and_onnx_configs, onnx_files_subpaths
      )
  
      # Attempt to merge only if the decoder-only was exported separately without/with past
      if self.use_past is True and len(models_and_onnx_configs) == 2:
          decoder_path = Path(path, onnx_files_subpaths[0])
          decoder_with_past_path = Path(path, onnx_files_subpaths[1])
          decoder_merged_path = Path(
              path, ONNX_DECODER_MERGED_NAME + ".onnx"
          )
          try:
              merge_decoders(
                  decoder=decoder_path,
                  decoder_with_past=decoder_with_past_path,
                  save_path=decoder_merged_path,
              )
          except Exception as e:
              raise Exception(
                  f"Unable to merge decoders. Detailed error: {e}"
              )
  
          # In order to do the validation of the two branches on the same file
          onnx_files_subpaths = [
              decoder_merged_path.name,
              decoder_merged_path.name,
          ]
  
          # We validate the two branches of the decoder model then
          models_and_onnx_configs[ONNX_DECODER_NAME][1].is_merged = True
          models_and_onnx_configs[ONNX_DECODER_NAME][
              1
          ].use_cache_branch = False
  
          # Past key values won't be generated by default, but added in the input
          models_and_onnx_configs[ONNX_DECODER_NAME][
              1
          ].use_past_in_inputs = True
  
          models_and_onnx_configs[ONNX_DECODER_WITH_PAST_NAME][
              1
          ].use_cache_branch = True
          models_and_onnx_configs[ONNX_DECODER_WITH_PAST_NAME][
              1
          ].is_merged = True
  
      return models_and_onnx_configs, onnx_files_subpaths
  
imports: from collections import OrderedDict
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Union
  from transformers.utils import is_tf_available
  from ...onnx import merge_decoders
  from ...utils import DummyAudioInputGenerator, DummyBboxInputGenerator, DummyInputGenerator, DummyPastKeyValuesGenerator, DummySeq2SeqDecoderTextInputGenerator, DummySeq2SeqPastKeyValuesGenerator, DummyTextInputGenerator, DummyVisionInputGenerator, is_diffusers_available, logging
  from .base import ConfigBehavior, OnnxConfig, OnnxConfigWithPast, OnnxSeq2SeqConfigWithPast
  from .constants import ONNX_DECODER_MERGED_NAME, ONNX_DECODER_NAME, ONNX_DECODER_WITH_PAST_NAME
  from .model_patcher import DecoderModelPatcher
label_desc: Use image node_id 4 for calling the TextDecoderOnnxConfig obj's underlying member method code with example usage: obj.post_process_exported_models(path, models_and_onnx_configs, onnx_files_subpaths) and returns: models_and_onnx_configs,  onnx_files_subpaths