code: def coll_fn(batch):
      input_ids_list, labels_list = [], []
      for instance in batch:
          input_ids_list.append(
              torch.tensor(instance["input_ids"], dtype=torch.long)
          )
          labels_list.append(
              torch.tensor(instance["labels"], dtype=torch.long)
          )
      return {
          "input_ids": pad_sequence(
              input_ids_list, batch_first=True, padding_value=20003
          ),
          "labels": pad_sequence(
              labels_list, batch_first=True, padding_value=20003
          ),
      }
  
file_path: DeepKE/example/llm/InstructKGC/src/finetuning_pt.py
imports: import argparse
  import os
  from shutil import copy
  import json
  import torch
  from torch.nn.utils.rnn import pad_sequence
  from torch.utils.data import Dataset, RandomSampler, DataLoader
  import deepspeed
  from transformers import AutoConfig, AutoTokenizer, AutoModel
label_desc: Use image node_id 1 for calling a global function with example usage: coll_fn(batch) and returns: dict