code: def test_conversion(args, hf_model, gluon_model):
      logging.info("testing conversion...")
      # create dummy input
      batch_size = 6
      src_length = 128
      tgt_length = 8
      vocab_size = hf_model.shared.weight.shape[0]
      src_data = np.random.randint(
          1, vocab_size, (batch_size, src_length)
      )
      src_valid_length = np.random.randint(
          src_length // 2, src_length, (batch_size,)
      )
      tgt_data = np.random.randint(
          1, vocab_size, (batch_size, tgt_length)
      )
      tgt_valid_length = np.random.randint(
          tgt_length // 2, tgt_length, (batch_size,)
      )
      enc_attn_mask = npx.arange_like(
          src_data, axis=-1
      ) < src_valid_length.reshape(-1, 1)
      dec_attn_mask = npx.arange_like(
          tgt_data, axis=-1
      ) < tgt_valid_length.reshape(-1, 1)
      # test T5Model forward pass
      hf_model.eval()  # disable dropout
      hf_out = (
          hf_model(
              input_ids=torch.from_numpy(src_data.asnumpy()),
              attention_mask=torch.from_numpy(enc_attn_mask.asnumpy()),
              decoder_input_ids=torch.from_numpy(tgt_data.asnumpy()),
              decoder_attention_mask=torch.from_numpy(
                  dec_attn_mask.asnumpy()
              ),
          )["last_hidden_state"]
          .detach()
          .numpy()
      )
      gl_out = gluon_model(
          src_data, src_valid_length, tgt_data, tgt_valid_length
      )
      for i in range(batch_size):
          assert np.allclose(
              hf_out[i, : tgt_valid_length[i].item(), :],
              gl_out[i, : tgt_valid_length[i].item(), :],
              1e-3,
              1e-3,
          )
      logging.info("pass")
  
imports: import argparse
  import logging
  import json
  import os
  import shutil
  import tempfile
  import torch
  import mxnet
  from mxnet import np, npx
  from gluonnlp.attention_cell import gen_self_attn_mask, gen_mem_attn_mask
  from gluonnlp.data.tokenizers import SentencepieceTokenizer
  from gluonnlp.models.t5 import T5Model
  from gluonnlp.utils.misc import download, logging_config, sha1sum, naming_convention
  from transformers import T5Model
label_desc: Use image node_id 6 for calling a global function with example usage: test_conversion(args, hf_model, gluon_model) without return types