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: Find the token ids corresponding to the answer start, for loss masking purposes.
  Assumes the answer is always at the end of the prompt.
docstr_tok: ["Find","the","token","ids","corresponding","to","the","answer","start",",","for","loss","masking","purposes",".","Assumes","the","answer","is","always","at","the","end","of","the","prompt","."]
code: def _find_answer_start(self, taskname, input_ids, answer_field, doc):
      """Find the token ids corresponding to the answer start, for loss masking purposes.
      Assumes the answer is always at the end of the prompt.
      """
      answer_text = doc[answer_field]
      answer_text = self._add_leading_space(
          taskname, answer_field, answer_text
      )
      answer_text_ids = self.tokenizer.text_to_ids(answer_text)
      num_answer_text_ids = len(answer_text_ids)
  
      if self.add_eos:
          num_answer_text_ids += 1
  
      answer_start_idx = len(input_ids) - num_answer_text_ids
  
      return answer_start_idx
  
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 7 for calling the GPTPromptLearningDataset obj's underlying member method code with example usage: obj._find_answer_start(taskname, input_ids, answer_field, doc) and returns: answer_start_idx