add BartConfig.force_bos_token_to_be_generated (#6526)

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
Sam Shleifer
2020-08-18 19:15:50 -04:00
committed by GitHub
parent 974bb4af26
commit 1529bf9680
4 changed files with 12 additions and 15 deletions

View File

@@ -484,7 +484,7 @@ class BartModelIntegrationTests(unittest.TestCase):
self.assertFalse(model.config.is_valid_mbart())
tok = BartTokenizer.from_pretrained("facebook/bart-large")
EXPECTED_SUMMARY = "California's largest power company has begun shutting off power to tens of thousands of homes and businesses in the state."
EXPECTED_SUMMARY = "California's largest power company has begun shutting off electricity to thousands of customers in the state."
dct = tok.batch_encode_plus(
[PGE_ARTICLE], max_length=1024, padding="max_length", truncation=True, return_tensors="pt",
).to(torch_device)