[Bart] Replace config.output_past with use_cache kwarg (#3632)

This commit is contained in:
Sam Shleifer
2020-04-07 19:08:26 -04:00
committed by GitHub
parent e344e3d402
commit 715aa5b135
4 changed files with 25 additions and 26 deletions

View File

@@ -20,7 +20,7 @@ def generate_summaries(
examples: list, out_file: str, model_name: str, batch_size: int = 8, device: str = DEFAULT_DEVICE
):
fout = Path(out_file).open("w")
model = BartForConditionalGeneration.from_pretrained(model_name, output_past=True,).to(device)
model = BartForConditionalGeneration.from_pretrained(model_name).to(device)
tokenizer = BartTokenizer.from_pretrained("bart-large")
max_length = 140