docstr: If there are enough hypotheses and that none of the hypotheses being generated
  can become better than the worst one in the heap, then we are done with this sentence.
code: def is_done(self, best_sum_logprobs):
      """
      If there are enough hypotheses and that none of the hypotheses being generated
      can become better than the worst one in the heap, then we are done with this sentence.
      """
      if len(self) < self.num_beams:
          return False
      elif self.early_stopping:
          return True
      else:
          return (
              self.worst_score
              >= best_sum_logprobs
              / self.max_length**self.length_penalty
          )
  
imports: import torch
  from torch import nn
  from torch.nn import functional
  from transformers.models.bart.configuration_bart import BartConfig
  from .modeling_bart import BartModel
  from ..utils.util import avg_token_embeddings, seq_to_mask, get_model_device
  from functools import partial
  from typing import Union
label_desc: Use image node_id 4 for calling the BeamHypotheses obj's underlying member method code with example usage: obj.is_done(best_sum_logprobs) and returns: False, True, unknown