class_docstr: This is a special template used only for search of template in LM-BFF. For example, a template could be ``{"placeholder": "text_a"}{"mask"}{"meta":"labelword"}{"mask"}``, where ``{"meta":"labelword"}`` is replaced by label_words in verbalizer in `wrap_one_example` method, and ``{"mask"}`` is replaced by special tokens used for generation, for T5, it is ``<extra_id_0>, <extra_id_1>, ...``.
  
  Args:
      tokenizer (:obj:`PreTrainedTokenizer`): A tokenizer to appoint the vocabulary and the tokenization strategy.
      verbalizer (:obj:`ManualVerbalizer`): A verbalizer to provide label_words.
      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: ["This","is","a","special","template","used","only","for","search","of","template","in","LM-BFF",".","For","example",",","a","template","could","be","``","{","``","placeholder","''",":","``","text_a","''","}","{","``","mask","''","}","{","``","meta","''",":","''","labelword","''","}","{","``","mask","''","}","``",",","where","``","{","``","meta","''",":","''","labelword","''","}","``","is","replaced","by","label_words","in","verbalizer","in","`","wrap_one_example","`","method",",","and","``","{","``","mask","''","}","``","is","replaced","by","special","tokens","used","for","generation",",","for","T5",",","it","is","``","<","extra_id_0",">",",","<","extra_id_1",">",",","...","``",".","Args",":","tokenizer","(",":","obj",":","`","PreTrainedTokenizer","`",")",":","A","tokenizer","to","appoint","the","vocabulary","and","the","tokenization","strategy",".","verbalizer","(",":","obj",":","`","ManualVerbalizer","`",")",":","A","verbalizer","to","provide","label_words",".","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,
      tokenizer: T5Tokenizer,
      verbalizer: ManualVerbalizer,
      text: Optional[List[str]] = None,
      placeholder_mapping: dict = {
          "<text_a>": "text_a",
          "<text_b>": "text_b",
      },
  ):
      super().__init__(
          tokenizer=tokenizer,
          text=text,
          placeholder_mapping=placeholder_mapping,
      )
      self.verbalizer = verbalizer
  
imports: from abc import abstractmethod
  from builtins import ValueError
  from typing import List, Optional, Dict, Union
  from tokenizers import Tokenizer
  import json
  import torch
  import torch.nn.functional
  from yacs.config import CfgNode
  from openprompt.data_utils.utils import InputExample, InputFeatures
  from openprompt.pipeline_base import PromptDataLoader, PromptModel
  from openprompt.prompt_base import Template, Verbalizer
  from openprompt.prompts import ManualTemplate, ManualVerbalizer
  from ..utils import logger
  from transformers import T5Tokenizer, T5ForConditionalGeneration, BertForMaskedLM, RobertaForMaskedLM, RobertaTokenizer, PreTrainedModel, PreTrainedTokenizer
  from tqdm import tqdm
  from typing import List, Optional, Dict
  import itertools
  import numpy
  from ..utils import signature
  from ..config import convert_cfg_to_dict
  from torch.nn.parallel import DataParallel
label_desc: Use image node_id 1 to create a new LMBFFTemplateGenerationTemplate object from inherited base classes: ManualTemplate with example: obj = LMBFFTemplateGenerationTemplate(tokenizer, verbalizer, text, placeholder_mapping)