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:
@@ -633,11 +633,7 @@ class GenerationIntegrationTestsMixin:
|
||||
"do_sample": False,
|
||||
"num_beams": 3,
|
||||
}
|
||||
if is_pt:
|
||||
expectation = 20
|
||||
else:
|
||||
# TODO (joao): fix me
|
||||
expectation = 13
|
||||
expectation = 13
|
||||
|
||||
tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-gpt2")
|
||||
text = """Hello, my dog is cute and"""
|
||||
|
||||
Reference in New Issue
Block a user