class_docstr: BERT encoder with QA head training.
class_docstr_tok: ["BERT","encoder","with","QA","head","training","."]
code: def _setup_dataloader_from_config(self, cfg: DictConfig, mode: str):
      dataset = SquadDataset(
          tokenizer=self.tokenizer,
          data_file=cfg.file,
          keep_doc_spans="all",  # self._cfg.dataset.keep_doc_spans,
          doc_stride=self._cfg.dataset.doc_stride,
          max_query_length=self._cfg.dataset.max_query_length,
          max_seq_length=self._cfg.dataset.max_seq_length,
          version_2_with_negative=self._cfg.dataset.version_2_with_negative,
          num_samples=cfg.num_samples,
          mode=mode,
          use_cache=self._cfg.dataset.use_cache,
      )
  
      dl = torch.utils.data.DataLoader(
          dataset=dataset,
          batch_size=cfg.batch_size,
          collate_fn=dataset.collate_fn,
          drop_last=cfg.drop_last,
          shuffle=cfg.shuffle,
          num_workers=cfg.num_workers,
          pin_memory=cfg.pin_memory,
      )
      return dl
  
imports: import json
  from typing import Optional
  import torch
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from torch.cuda.amp import autocast
  from nemo.collections.common.losses import SpanningLoss
  from nemo.collections.nlp.data import SquadDataset
  from nemo.collections.nlp.data.question_answering_squad.qa_squad_processing import EVALUATION_MODE, INFERENCE_MODE, TRAINING_MODE
  from nemo.collections.nlp.models.nlp_model import NLPModel
  from nemo.collections.nlp.modules.common import TokenClassifier
  from nemo.collections.nlp.parts.utils_funcs import tensor2list
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.utils import logging
label_desc: Use image node_id 12 for calling the QAModel obj's underlying member method code with example usage: obj._setup_dataloader_from_config(cfg, mode) and returns: dl