code: def load_decoder_params(
      train_state: train_utils.TrainState,
      config: ml_collections.ConfigDict,
  ):
      """Load T5 decoder params from a checkpoint."""
      init_config = config.init_from
      t5_params = {}
      load = False
      if init_config.get("decoder") and init_config.decoder.get(
          "load_pretrained_weights", True
      ):
          model_name = config.model.decoder.t5_decoder.pretrained_config
          t5_params = t5_model.load_pretrained_weights(model_name)
          load = True
      logging.info("T5 params are:")
      logging.info(jax.tree_util.tree_map(lambda x: x.shape, t5_params))
      if not load:
          return train_state
      train_state = load_utils.init_from_pretrain_weights(
          train_state,
          restored_params=t5_params,
          ckpt_prefix_path=["params", "t5_module", "token_embedder"],
          model_prefix_path=["shared_decoder_token_embedder"],
      )
      return load_utils.init_from_pretrain_weights(
          train_state,
          restored_params=t5_params,
          ckpt_prefix_path=["params", "t5_module", "decoder"],
          model_prefix_path=["text_decoder", "decoder_module"],
      )
  
imports: import copy
  import dataclasses
  import functools
  import json
  import os
  import random
  from typing import Any, Callable, Dict, List, Optional, Tuple
  from absl import logging
  from clu import metric_writers
  from clu import periodic_actions
  from dmvr import tokenizers
  from flax import jax_utils
  from flax.core import unfreeze
  import flax.linen
  import jax
  import jax.example_libraries.optimizers
  import jax.numpy
  import jax.profiler
  import ml_collections
  import numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.model_lib.base_models import base_model
  from scenic.projects.t5 import model
  from scenic.projects.t5 import tokenizer
  from scenic.projects.vid2seq import load_utils
  from scenic.projects.vid2seq import models
  from scenic.projects.vid2seq import train_utils
  from scenic.projects.vid2seq import dvc_eval
  from scenic.train_lib_deprecated import lr_schedules
  from scenic.train_lib_deprecated import optimizers
  from scenic.train_lib_deprecated import pretrain_utils
  from scenic.train_lib_deprecated import train_utils
label_desc: Use image node_id 7 for calling a global function with example usage: load_decoder_params(train_state, config) and returns: load_utils, train_state