code: def _get_answers_from_generated_tokens(
      self, token_ids, training_mask_end=None
  ):
      answers = []
      for i in range(token_ids.size(0)):
          start_point = (
              0
              if training_mask_end is None
              else training_mask_end[i].item()
          )
          stop_point = token_ids.size(1)
  
          for j in range(start_point, stop_point):
              if (
                  token_ids.data[i, j]
                  == self.tokenizer.tokenizer.pad_token_id
              ):
                  stop_point = j
                  break
  
          curr_answer = self.tokenizer.tokenizer.decode(
              token_ids[i, start_point:stop_point],
              skip_special_tokens=True,
          ).strip()
          answers.append(curr_answer)
  
      return answers
  
imports: import collections
  from typing import List, Optional
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from transformers import AutoModelForCausalLM
  from nemo.collections.nlp.data.question_answering.data_processor.qa_processing import QAProcessor
  from nemo.collections.nlp.data.question_answering.dataset.qa_gpt_dataset import GPTQADataset
  from nemo.collections.nlp.metrics.qa_metrics import QAMetrics
  from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel
  from nemo.collections.nlp.models.question_answering.qa_base_model import BaseQAModel
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.utils import logging
label_desc: Use image node_id 15 for calling the GPTQAModel obj's underlying member method code with example usage: obj._get_answers_from_generated_tokens(token_ids, training_mask_end) and returns: answers