code: def build_sample(token_ids, token_types, num_tokens, reference):
      """
      Convert to numpy and return a sample consumed by the
      batch producer.
      """
  
      token_ids = np.array(token_ids, dtype=np.int64)
      token_types = np.array(token_types, dtype=np.int64)
      token_mask = make_attention_mask(token_ids, token_ids)
  
      sample = {
          "token_ids": token_ids,
          "token_mask": token_mask,
          "token_types": token_types,
          "seq_len": num_tokens,
          "reference": reference,
      }
      return sample
  
imports: from abc import ABC
  import csv
  from collections import OrderedDict
  import numpy
  import torch
  from torch.utils.data import DataLoader
  from torch.utils.data import Dataset, BatchSampler
  from megatron import print_rank_0, get_args, get_tokenizer
  from megatron.data.biencoder_dataset_utils import make_attention_mask
label_desc: Use image node_id 6 for calling a global function with example usage: build_sample(token_ids, token_types, num_tokens, reference) and returns: sample