MCPcopy Create free account
hub / github.com/SooLab/CGFormer / __init__

Method __init__

bert/generation_utils.py:949–958  ·  view source on GitHub ↗

Initialize n-best list of hypotheses.

(self, num_beams, max_length, length_penalty, early_stopping)

Source from the content-addressed store, hash-verified

947
948class BeamHypotheses(object):
949 def __init__(self, num_beams, max_length, length_penalty, early_stopping):
950 """
951 Initialize n-best list of hypotheses.
952 """
953 self.max_length = max_length - 1 # ignoring bos_token
954 self.length_penalty = length_penalty
955 self.early_stopping = early_stopping
956 self.num_beams = num_beams
957 self.beams = []
958 self.worst_score = 1e9
959
960 def __len__(self):
961 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected