🚨🚨 Fix beam score calculation issue for decoder-only models (#27351)

* Fix beam score calculation issue for decoder-only models

* Update beam search test and fix code quality issue

* Fix beam_sample, group_beam_search and constrained_beam_search

* Split test for pytorch and TF, add documentation

---------

Co-authored-by: Xin Qiu <xin.qiu@sentient.ai>
This commit is contained in:
Xin Qiu
2023-11-15 20:49:14 +08:00
committed by GitHub
parent 3d1a7bf476
commit 453079c7f8
3 changed files with 55 additions and 9 deletions

View File

@@ -633,7 +633,11 @@ class GenerationIntegrationTestsMixin:
"do_sample": False,
"num_beams": 3,
}
expectation = 13
if is_pt:
expectation = 20
else:
# TODO (joao): fix me
expectation = 13
tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-gpt2")
text = """Hello, my dog is cute and"""