class_docstr: A runner for prototypical verbalizer
  This class is specially implemented for classification.
  
  Args:
      model (:obj:`PromptForClassification`): One ``PromptForClassification`` 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.
class_docstr_tok: ["A","runner","for","prototypical","verbalizer","This","class","is","specially","implemented","for","classification",".","Args",":","model","(",":","obj",":","`","PromptForClassification","`",")",":","One","``","PromptForClassification","``","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 __init__(
      self,
      model: PromptForClassification,
      config: CfgNode = None,
      train_dataloader: Optional[PromptDataLoader] = None,
      valid_dataloader: Optional[PromptDataLoader] = None,
      test_dataloader: Optional[PromptDataLoader] = None,
      loss_function: Optional[Callable] = None,
      id2label: Optional[Dict] = None,
  ):
      super().__init__(
          model=model,
          config=config,
          train_dataloader=train_dataloader,
          valid_dataloader=valid_dataloader,
          test_dataloader=test_dataloader,
      )
      self.loss_function = (
          loss_function
          if loss_function
          else self.configure_loss_function()
      )
      self.id2label = id2label
      self.label_path_sep = config.dataset.label_path_sep
  
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.trainer import BaseRunner, ClassificationRunner
  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 1 to create a new ProtoVerbClassificationRunner object from inherited base classes: BaseRunner with example: obj = ProtoVerbClassificationRunner(model, config, train_dataloader, valid_dataloader, test_dataloader, loss_function, id2label)