class_docstr: This class can be used to stop generation whenever the full generated number of tokens exceeds `max_length`. Keep
  in mind for decoder-only type of transformers, this will include the initial prompted tokens.
  
  Args:
      max_length (`int`):
          The maximum length that the output sequence can have in number of tokens.
class_docstr_tok: ["This","class","can","be","used","to","stop","generation","whenever","the","full","generated","number","of","tokens","exceeds","`","max_length","`",".","Keep","in","mind","for","decoder-only","type","of","transformers",",","this","will","include","the","initial","prompted","tokens",".","Args",":","max_length","(","`","int","`",")",":","The","maximum","length","that","the","output","sequence","can","have","in","number","of","tokens","."]
code: def __init__(self, max_length: int):
      self.max_length = max_length
  
imports: import time
  import warnings
  from abc import ABC
  from copy import deepcopy
  from typing import Optional
  import torch
  from .utils import add_start_docstrings
label_desc: Use image node_id 1 to create a new MaxLengthCriteria object from inherited base classes: StoppingCriteria with example: obj = MaxLengthCriteria(max_length)