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.
docstr_tok: ["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, cur_len):
      """
      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.n_hyp:
          return False
      elif self.early_stopping:
          return True
      else:
          return (
              self.worst_score
              >= best_sum_logprobs / cur_len**self.length_penalty
          )
  
file_path: DeepKE/example/llm/CPM-Bee/src/cpm_live/generation/generation_utils.py
imports: import torch
  import torch.nn.functional
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, cur_len) and returns: False, True, unknown