class_docstr: Creates a Dataset for GPT architecture based Generative QA 
class_docstr_tok: ["Creates","a","Dataset","for","GPT","architecture","based","Generative","QA"]
code: def __getitem__(self, idx: int):
      feature = self.features[idx]
      if self.mode == INFERENCE_MODE:
          return (
              np.array(feature.input_ids),
              np.array(feature.input_attn_mask),
              np.array(feature.unique_id),
              np.array(feature.training_mask_end),
          )
      else:
          return (
              np.array(feature.input_ids),
              np.array(feature.input_attn_mask),
              np.array(feature.unique_id),
              np.array(feature.training_mask_end),
              np.array(feature.labels),
          )
  
imports: import copy
  import os
  import numpy
  import torch
  from tqdm import trange
  from nemo.collections.nlp.data.question_answering.data_processor.qa_processing import INFERENCE_MODE, TRAINING_MODE
  from nemo.collections.nlp.data.question_answering.dataset.qa_dataset import QADataset
  from nemo.collections.nlp.data.question_answering.input_example.qa_gpt_input_example import GPTQAInputExample
  from nemo.utils import logging
label_desc: Use image node_id 10 for calling the GPTQADataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: np,  np,  np,  np, np,  np,  np,  np,  np