class_docstr: This class can be used to stop generation whenever the generated number of tokens exceeds :obj:`max_new_tokens`.
  Keep in mind for decoder-only type of transformers, this will **not** include the initial prompted tokens. This is
  very close to :obj:`MaxLengthCriteria` but ignores the number of initial tokens.
  
  Args:
      start_length (:obj:`int`):
          The number of initial tokens.
      max_new_tokens (:obj:`int`):
          The maximum number of tokens to generate.
class_docstr_tok: ["This","class","can","be","used","to","stop","generation","whenever","the","generated","number","of","tokens","exceeds",":","obj",":","`","max_new_tokens","`",".","Keep","in","mind","for","decoder-only","type","of","transformers",",","this","will","*","*","not","*","*","include","the","initial","prompted","tokens",".","This","is","very","close","to",":","obj",":","`","MaxLengthCriteria","`","but","ignores","the","number","of","initial","tokens",".","Args",":","start_length","(",":","obj",":","`","int","`",")",":","The","number","of","initial","tokens",".","max_new_tokens","(",":","obj",":","`","int","`",")",":","The","maximum","number","of","tokens","to","generate","."]
code: def __call__(
      self,
      input_ids: "torch.LongTensor",
      scores: "torch.FloatTensor",
      **kwargs,
  ) -> bool:
      return input_ids.shape[-1] >= self.max_length
  
imports: import time
  from abc import ABC
  from copy import deepcopy
  from typing import Optional
  from .file_utils import add_start_docstrings
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH
  from fastNLP.core.log import logger
label_desc: Use image node_id 2 for calling the MaxNewTokensCriteria obj's underlying member method code with example usage: obj.__call__(input_ids, scores) and returns: unknown