class_docstr: BERT encoder with QA head training.
class_docstr_tok: ["BERT","encoder","with","QA","head","training","."]
docstr: This method returns a list of pre-trained model which can be instantiated directly from NVIDIA's NGC cloud.
  
  Returns:
      List of available pre-trained models.
docstr_tok: ["This","method","returns","a","list","of","pre-trained","model","which","can","be","instantiated","directly","from","NVIDIA","'s","NGC","cloud",".","Returns",":","List","of","available","pre-trained","models","."]
code: def list_available_models(cls) -> Optional[PretrainedModelInfo]:
      """
      This method returns a list of pre-trained model which can be instantiated directly from NVIDIA's NGC cloud.
  
      Returns:
          List of available pre-trained models.
      """
      result = []
  
      result.append(
          PretrainedModelInfo(
              pretrained_model_name="qa_squadv1.1_bertbase",
              location="https://api.ngc.nvidia.com/v2/models/nvidia/nemo/qa_squadv1_1_bertbase/versions/1.0.0rc1/files/qa_squadv1.1_bertbase.nemo",
              description="Question answering model finetuned from NeMo BERT Base Uncased on SQuAD v1.1 dataset which obtains an exact match (EM) score of 82.78% and an F1 score of 89.97%.",
          )
      )
  
      result.append(
          PretrainedModelInfo(
              pretrained_model_name="qa_squadv2.0_bertbase",
              location="https://api.ngc.nvidia.com/v2/models/nvidia/nemo/qa_squadv2_0_bertbase/versions/1.0.0rc1/files/qa_squadv2.0_bertbase.nemo",
              description="Question answering model finetuned from NeMo BERT Base Uncased on SQuAD v2.0 dataset which obtains an exact match (EM) score of 75.04% and an F1 score of 78.08%.",
          )
      )
  
      result.append(
          PretrainedModelInfo(
              pretrained_model_name="qa_squadv1_1_bertlarge",
              location="https://api.ngc.nvidia.com/v2/models/nvidia/nemo/qa_squadv1_1_bertlarge/versions/1.0.0rc1/files/qa_squadv1.1_bertlarge.nemo",
              description="Question answering model finetuned from NeMo BERT Large Uncased on SQuAD v1.1 dataset which obtains an exact match (EM) score of 85.44% and an F1 score of 92.06%.",
          )
      )
  
      result.append(
          PretrainedModelInfo(
              pretrained_model_name="qa_squadv2.0_bertlarge",
              location="https://api.ngc.nvidia.com/v2/models/nvidia/nemo/qa_squadv2_0_bertlarge/versions/1.0.0rc1/files/qa_squadv2.0_bertlarge.nemo",
              description="Question answering model finetuned from NeMo BERT Large Uncased on SQuAD v2.0 dataset which obtains an exact match (EM) score of 80.22% and an F1 score of 83.05%.",
          )
      )
  
      result.append(
          PretrainedModelInfo(
              pretrained_model_name="qa_squadv1_1_megatron_cased",
              location="https://api.ngc.nvidia.com/v2/models/nvidia/nemo/qa_squadv1_1_megatron_cased/versions/1.0.0rc1/files/qa_squadv1.1_megatron_cased.nemo",
              description="Question answering model finetuned from Megatron Cased on SQuAD v1.1 dataset which obtains an exact match (EM) score of 88.18% and an F1 score of 94.07%.",
          )
      )
  
      result.append(
          PretrainedModelInfo(
              pretrained_model_name="qa_squadv2.0_megatron_cased",
              location="https://api.ngc.nvidia.com/v2/models/nvidia/nemo/qa_squadv2_0_megatron_cased/versions/1.0.0rc1/files/qa_squadv2.0_megatron_cased.nemo",
              description="Question answering model finetuned from Megatron Cased on SQuAD v2.0 dataset which obtains an exact match (EM) score of 84.73% and an F1 score of 87.89%.",
          )
      )
  
      result.append(
          PretrainedModelInfo(
              pretrained_model_name="qa_squadv1.1_megatron_uncased",
              location="https://api.ngc.nvidia.com/v2/models/nvidia/nemo/qa_squadv1_1_megatron_uncased/versions/1.0.0rc1/files/qa_squadv1.1_megatron_uncased.nemo",
              description="Question answering model finetuned from Megatron Unased on SQuAD v1.1 dataset which obtains an exact match (EM) score of 87.61% and an F1 score of 94.00%.",
          )
      )
  
      result.append(
          PretrainedModelInfo(
              pretrained_model_name="qa_squadv2.0_megatron_uncased",
              location="https://api.ngc.nvidia.com/v2/models/nvidia/nemo/qa_squadv2_0_megatron_uncased/versions/1.0.0rc1/files/qa_squadv2.0_megatron_uncased.nemo",
              description="Question answering model finetuned from Megatron Uncased on SQuAD v2.0 dataset which obtains an exact match (EM) score of 84.48% and an F1 score of 87.65%.",
          )
      )
      return result
  
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 13 for calling the QAModel obj's underlying member method code with example usage: obj.list_available_models(cls) and returns: result