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: Insert the correct number of pseudo tokens at the <|VIRTUAL_PROMPT_n|> markers 
docstr_tok: ["Insert","the","correct","number","of","pseudo","tokens","at","the","<","|VIRTUAL_PROMPT_n|",">","markers"]
code: def _insert_virtual_token_placeholders(
      self, input_example, virtual_token_splits
  ):
      """Insert the correct number of pseudo tokens at the <|VIRTUAL_PROMPT_n|> markers"""
      total_inserted_tokens = 0
  
      for idx in range(len(virtual_token_splits)):
          split_start = total_inserted_tokens
          split_end = total_inserted_tokens + virtual_token_splits[idx]
          pseudo_tokens_for_split = "".join(
              self.pseudo_tokens[split_start:split_end]
          )
          input_example = input_example.replace(
              f"<|VIRTUAL_PROMPT_{idx}|>", pseudo_tokens_for_split
          )
          total_inserted_tokens = split_end
  
      return input_example
  
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 5 for calling the GPTPromptLearningDataset obj's underlying member method code with example usage: obj._insert_virtual_token_placeholders(input_example, virtual_token_splits) and returns: input_example