class_docstr: This class can be used to stop generation whenever the full generation exceeds some amount of time. By default, the
  time will start being counted when you initialize this function. You can override this by passing an
  `initial_time`.
  
  Args:
      max_time (`float`):
          The maximum allowed time in seconds for the generation.
      initial_time (`float`, *optional*, defaults to `time.time()`):
          The start of the generation allowed time.
class_docstr_tok: ["This","class","can","be","used","to","stop","generation","whenever","the","full","generation","exceeds","some","amount","of","time",".","By","default",",","the","time","will","start","being","counted","when","you","initialize","this","function",".","You","can","override","this","by","passing","an","`","initial_time","`",".","Args",":","max_time","(","`","float","`",")",":","The","maximum","allowed","time","in","seconds","for","the","generation",".","initial_time","(","`","float","`",",","*","optional","*",",","defaults","to","`","time.time","(",")","`",")",":","The","start","of","the","generation","allowed","time","."]
code: def __call__(
      self,
      input_ids: torch.LongTensor,
      scores: torch.FloatTensor,
      **kwargs,
  ) -> bool:
      return time.time() - self.initial_timestamp > self.max_time
  
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, logging
label_desc: Use image node_id 2 for calling the MaxTimeCriteria obj's underlying member method code with example usage: obj.__call__(input_ids, scores) and returns: unknown