class_docstr: The dataset class for prompt-tuning or p-tuning pretrained GPT models.
  
  Args:
      data (list[strings], list[dicts]): (1) paths to .jsonl or .json files, (2) dict objects corresponding to each input example
      tokenizer (tokenizer): Tokenizer from frozen language model
      virtual_prompt_source (Enum): Either VirtualPromptSource.NO_PROMPTS or VirtualPromptSource.PROMPT_ENCODER
      task_templates (dict): Dictionary containing all task template information needed to format prompts. Created in the GPTPromptLearningModel class.
      pseudo_tokens (list[strings]): A list of virtual prompt token placeholders e.g [<prompt_1>, <prompt_2>, ...] up to max num virtual tokens
      pad_token_id (int): ID of pad token from tokenizer
      max_seq_length (int): maximum sequence length for each dataset examples. Examples will either be truncated to fit this length or dropped if they cannot be truncated.
      min_seq_length (int): min length of each data example in the dataset. Data examples will be dropped if they do not meet the min length requirements. 
      add_bos (bool): Whether to add a beginning of sentence token to each data example
      add_eos (bool): Whether to add an end of sentence token to each data example
      for_train (bool): Whether you're creating a dataset for training or inference
      tokens_to_generate (int): (inference only) Number of tokens to generate during inference
docstr: Used for loading inference data. 
docstr_tok: ["Used","for","loading","inference","data","."]
code: def inference_collate_fn(self, batch):
      """
      Used for loading inference data.
      """
      task_id_nums, input_ids, answer_starts = zip(*batch)
      input_lengths = torch.cuda.LongTensor(
          [len(inputs) for inputs in input_ids]
      )
      task_id_nums = torch.cuda.LongTensor(task_id_nums)
      batch_max = input_lengths.max().item()
      batch_max += self.tokens_to_generate
  
      input_ids, _ = self.pad_batch_and_build_loss_mask(
          input_ids, batch_max, answer_starts
      )
      input_ids = input_ids.cuda()
      input_ids = torch.cuda.LongTensor(input_ids)
  
      return task_id_nums, (input_ids, input_lengths)
  
imports: import json
  import os
  import pickle
  import torch
  from tqdm.auto import tqdm
  from nemo.collections.nlp.modules.common import VirtualPromptSource
  from nemo.collections.nlp.modules.common.megatron.utils import build_position_ids
  from nemo.core import Dataset
  from nemo.utils import AppState, logging
label_desc: Use image node_id 14 for calling the GPTPromptLearningDataset obj's underlying member method code with example usage: obj.inference_collate_fn(batch) and returns: task_id_nums,  input_ids,  input_lengths