class_docstr: ``PromptModel`` is the encapsulation of ``Template`` and the ``pre-trained model``,
  with OpenPrompt, these modules could be flexibly combined. And this class is the base class of ``PromptForClassification`` and ``PromptForGeneration``
  
  Args:
      plm (:obj:`PreTrainedModel`): The pre-trained language model for the current prompt-learning task.
      template (:obj:`Template`): The ``Template`` object to warp the input data.
      freeze_plm (:obj:`bool`): whether or not to freeze the pretrained language model
      plm_eval_mode (:obj:`bool`): this is a stronger freezing mode than freeze_plm, i.e. the dropout of the model is turned off. No matter whether the other part is set to train.
class_docstr_tok: ["``","PromptModel","``","is","the","encapsulation","of","``","Template","``","and","the","``","pre-trained","model","``",",","with","OpenPrompt",",","these","modules","could","be","flexibly","combined",".","And","this","class","is","the","base","class","of","``","PromptForClassification","``","and","``","PromptForGeneration","``","Args",":","plm","(",":","obj",":","`","PreTrainedModel","`",")",":","The","pre-trained","language","model","for","the","current","prompt-learning","task",".","template","(",":","obj",":","`","Template","`",")",":","The","``","Template","``","object","to","warp","the","input","data",".","freeze_plm","(",":","obj",":","`","bool","`",")",":","whether","or","not","to","freeze","the","pretrained","language","model","plm_eval_mode","(",":","obj",":","`","bool","`",")",":","this","is","a","stronger","freezing","mode","than","freeze_plm",",","i.e",".","the","dropout","of","the","model","is","turned","off",".","No","matter","whether","the","other","part","is","set","to","train","."]
docstr: Will be used in generation
          
docstr_tok: ["Will","be","used","in","generation"]
code: def prepare_model_inputs(
      self, batch: Union[Dict, InputFeatures]
  ) -> Dict:
      r"""Will be used in generation"""
      batch = self.template.process_batch(batch)
      input_batch = {
          key: batch[key] for key in batch if key in self.forward_keys
      }
      return input_batch
  
imports: from pickle import FALSE
  from torch.utils.data.sampler import RandomSampler
  from transformers.configuration_utils import PretrainedConfig
  from transformers.generation_utils import GenerationMixin
  import torch
  import torch.nn
  from torch.utils.data import Dataset
  from typing import *
  from openprompt.data_utils import InputExample, InputFeatures
  from torch.utils.data._utils.collate import default_collate
  from tqdm.std import tqdm
  from transformers.tokenization_utils import PreTrainedTokenizer
  from transformers.utils.dummy_pt_objects import PreTrainedModel
  from openprompt.plms.utils import TokenizerWrapper
  from openprompt.prompt_base import Template, Verbalizer
  from collections import defaultdict
  from openprompt.utils import round_list, signature
  import numpy
  from torch.utils.data import DataLoader
  from yacs.config import CfgNode
  from openprompt.utils.logging import logger
  from transformers import AdamW, get_linear_schedule_with_warmup
label_desc: Use image node_id 5 for calling the PromptModel obj's underlying member method code with example usage: obj.prepare_model_inputs(batch) and returns: input_batch