Fix remaining issues in beam score calculation (#27808)
* Fix issues in add and is_done for BeamHypotheses * make newly added arguments optional for better compatibility * Directly use cur_len as generated_len, add note for retrocompatibility * update test expectation * make cur_len represents the length of the entire sequence including the decoder prompt * remove redundant if/else in testing
This commit is contained in:
@@ -800,7 +800,7 @@ class ViT2GPT2ModelIntegrationTest(unittest.TestCase):
|
||||
|
||||
preds, scores = generate_step(pixel_values)
|
||||
|
||||
EXPECTED_SCORES = np.array([-0.64145195])
|
||||
EXPECTED_SCORES = np.array([-0.5956343])
|
||||
max_diff = np.amax(np.abs(scores - EXPECTED_SCORES))
|
||||
self.assertLessEqual(max_diff, 1e-4)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user