class_docstr: Criteria to stop on the specified multi-token sequence.
class_docstr_tok: ["Criteria","to","stop","on","the","specified","multi-token","sequence","."]
code: def __init__(
      self,
      sequence: str,
      tokenizer: transformers.PreTrainedTokenizer,
      initial_decoder_input_length: int,
      batch_size: int,
  ):
      self.initial_decoder_input_length = initial_decoder_input_length
      self.done_tracker = [False] * batch_size
      self.sequence = sequence
      self.sequence_ids = tokenizer.encode(
          sequence, add_special_tokens=False
      )
      self.sequence_id_len = len(self.sequence_ids)
      self.tokenizer = tokenizer
  
imports: import math
  import torch
  import torch.nn.functional
  import transformers
  import peft
  from pathlib import Path
  from typing import List, Mapping, NewType, Optional, Tuple, Union
  from tqdm import tqdm
  from transformers import BatchEncoding
  from lm_eval import utils
  from lm_eval.base import BaseLM
label_desc: Use image node_id 1 to create a new MultiTokenEOSCriteria object from inherited base classes: transformers with example: obj = MultiTokenEOSCriteria(sequence, tokenizer, initial_decoder_input_length, batch_size)