class_docstr: A base runner for training without training tricks.
  Applying training tricks such as ensemble of template or verbalizer,
  or self-training can use other runner class.
  This class is specially implemented for classification.
  For generation task, though it can be integrated in this class
  via `task` option, we keep it as another class for simplicity.
  
  Args:
      model (:obj:`nn.Module`): One ``nn.Module`` object.
      train_dataloader (:obj:`PromptDataloader`, optional): The dataloader to bachify and process the training data.
      valid_dataloader (:obj:`PromptDataloader`, optionla): The dataloader to bachify and process the val data.
      test_dataloader (:obj:`PromptDataloader`, optional): The dataloader to bachify and process the test data.
      config (:obj:`CfgNode`): A configuration object.
      loss_function (:obj:`Callable`, optional): The loss function in the training process.
code: def fit(self, ckpt: Optional[str] = None):
      self.set_stop_criterion()
      self.configure_optimizers()
  
      if ckpt:
          if not self.load_checkpoint(ckpt):
              logger.warning("Train from scratch instead ...")
      if self.cur_epoch == 0:
          self.on_fit_start()
  
      for self.cur_epoch in range(self.cur_epoch, self.num_epochs):
          continue_training = self.training_epoch(self.cur_epoch)
          score = self.inference_epoch("validation")
          copy = None
          if (
              self.best_score is None
              or ((score - self.best_score) >= 0)
              == self.config.checkpoint.higher_better
          ):
              copy = "best"
              self.best_score = score
          self.save_checkpoint(
              "last", extra={"validation_metric": score}, copy=copy
          )
          if continue_training == -1:
              logger.info(
                  "Stop training by reaching maximum num_training_steps"
              )
              break
      return self.best_score
  
imports: import os, shutil
  import sys
  import torch
  from torch import nn
  from torch.nn.parallel.data_parallel import DataParallel
  from openprompt.utils.cuda import model_to_device
  from tensorboardX import SummaryWriter
  from tqdm import tqdm
  import dill
  import warnings
  from typing import Callable, Union, Dict
  from openprompt.pipeline_base import PromptForClassification, PromptForGeneration
  from openprompt import PromptDataLoader
  from openprompt.prompts import *
  from openprompt.utils.logging import logger
  from openprompt.utils.metrics import classification_metrics, generation_metric
  from transformers import AdamW, get_linear_schedule_with_warmup
  from transformers.optimization import Adafactor, AdafactorSchedule
label_desc: Use image node_id 16 for calling the BaseRunner obj's underlying member method code with example usage: obj.fit(ckpt) and returns: self