class_docstr: Args:
      model (:obj:`PreTrainedModel`): The pre-trained language model for the current prompt-learning task.
      tokenizer (:obj:`PreTrainedTokenizer`): A tokenizer to appoint the vocabulary and the tokenization strategy.
      prompt_encoder_type (:obj:`str`): head above the embedding layer of new tokens. Can be ``lstm`` or ``mlp``.
      text (:obj:`Optional[List[str]]`, optional): manual template format. Defaults to None.
      placeholder_mapping (:obj:`dict`): A place holder to represent the original input text. Default to ``{'<text_a>': 'text_a', '<text_b>': 'text_b'}``
class_docstr_tok: ["Args",":","model","(",":","obj",":","`","PreTrainedModel","`",")",":","The","pre-trained","language","model","for","the","current","prompt-learning","task",".","tokenizer","(",":","obj",":","`","PreTrainedTokenizer","`",")",":","A","tokenizer","to","appoint","the","vocabulary","and","the","tokenization","strategy",".","prompt_encoder_type","(",":","obj",":","`","str","`",")",":","head","above","the","embedding","layer","of","new","tokens",".","Can","be","``","lstm","``","or","``","mlp","``",".","text","(",":","obj",":","`","Optional","[","List","[","str","]","]","`",",","optional",")",":","manual","template","format",".","Defaults","to","None",".","placeholder_mapping","(",":","obj",":","`","dict","`",")",":","A","place","holder","to","represent","the","original","input","text",".","Default","to","``","{","'","<","text_a",">","'",":","'text_a","'",",","'","<","text_b",">","'",":","'text_b","'","}","``"]
code: def __init__(
      self,
      model: PreTrainedModel,
      tokenizer: PreTrainedTokenizer,
      text: Optional[List[str]] = None,
      prompt_encoder_type: str = "lstm",
      placeholder_mapping: dict = {
          "<text_a>": "text_a",
          "<text_b>": "text_b",
      },
  ):
      super().__init__(
          model=model,
          tokenizer=tokenizer,
          placeholder_mapping=placeholder_mapping,
      )
      self.prompt_encoder_type = prompt_encoder_type
      self.text = text
  
file_path: OpenPrompt/openprompt/prompts/ptuning_prompts.py
imports: from openprompt.data_utils import InputFeatures
  import os
  import torch
  from torch import nn
  from typing import *
  from transformers import PreTrainedModel
  from transformers.tokenization_utils import PreTrainedTokenizer
  from openprompt.prompts import MixedTemplate
label_desc: Use image node_id 1 to create a new PtuningTemplate object from inherited base classes: MixedTemplate with example: obj = PtuningTemplate(model, tokenizer, text, prompt_encoder_type, placeholder_mapping)