code: def turn_model_into_encoder_decoder(model):
      encoder = model.encoder
      decoder = model.decoder
      lm_head = model.lm_head
  
      decoder_with_lm_head = DecoderWithLMhead(
          decoder, lm_head, model.config
      )
      simplified_encoder = T5Encoder(encoder)
      decoder_with_lm_head_init = DecoderWithLMheadInitial(
          decoder, lm_head, model.config
      )
  
      return (
          simplified_encoder,
          decoder_with_lm_head,
          decoder_with_lm_head_init,
      )
  
file_path: fastT5/fastT5/onnx_exporter.py
imports: from .huggingface_utils import get_auth_token
  from .onnx_models_structure import T5Encoder, DecoderWithLMhead, DecoderWithLMheadInitial
  from transformers import AutoConfig, T5ForConditionalGeneration, MT5ForConditionalGeneration
  import torch
  import functools
  import operator
  from progress.bar import Bar
  from pathlib import Path
  import os
label_desc: Use image node_id 2 for calling a global function with example usage: turn_model_into_encoder_decoder(model) and returns: simplified_encoder,  decoder_with_lm_head,  decoder_with_lm_head_init