code: def __call__(
      self,
      input_ids: torch.LongTensor,
      scores: torch.FloatTensor,
      **kwargs,
  ) -> bool:
      # if self.tokenizer:
      #    print('stop: %s' % self.tokenizer.decode(input_ids[0]), flush=True)
      if self.token_start is None:
          self.token_start = input_ids[0].shape[0]
      if self.look_at_new_tokens_only:
          new_tokens = input_ids[0][self.token_start :]
      else:
          new_tokens = input_ids[0][0:]
      for stopi, (stop, stop_word) in enumerate(
          zip(self.stops, self.stop_words)
      ):
          current_block = new_tokens[-len(stop) :]
          stop_text = self.tokenizer.decode(current_block)
          len_new_tokens = current_block.shape[0]
          # if len(stop) <= len_new_tokens and torch.all((stop == input_ids[0][-len(stop):])).item():
          if len(stop) <= len_new_tokens and stop_word in stop_text:
              self.num_stops[stopi] += 1
              if (
                  self.num_stops[stopi]
                  >= self.encounters[stopi % len(self.encounters)]
              ):
                  # print("Stopped", flush=True)
                  return True
      if self.truncation_generation and (
          self.model_max_length is not None
          and input_ids[0].shape[0] >= self.model_max_length
      ):
          # critical limit
          return True
      # print("Tokens: %s" % input_ids[0].cpu().numpy(), flush=True)
      # print("Stop Tokens: %s" % [x.cpu().numpy() for x in self.stops], flush=True)
      return False
  
imports: import torch
  from transformers import StoppingCriteria, StoppingCriteriaList
  from enums import PromptType, t5_type
label_desc: Use image node_id 2 for calling the StoppingCriteriaSub obj's underlying member method code with example usage: obj.__call__(input_ids, scores) and returns: False, True, True