fix to adjust for #8530 changes (#8612)

This commit is contained in:
Stas Bekman
2020-11-18 07:25:00 -08:00
committed by GitHub
parent 2819da02f7
commit cdf1b7ae82

View File

@@ -148,7 +148,7 @@ class SummarizationModule(BaseTransformer):
self.save_readable_batch(batch) self.save_readable_batch(batch)
outputs = self(src_ids, attention_mask=src_mask, decoder_input_ids=decoder_input_ids, use_cache=False) outputs = self(src_ids, attention_mask=src_mask, decoder_input_ids=decoder_input_ids, use_cache=False)
lm_logits = outputs[0] lm_logits = outputs["logits"]
if self.hparams.label_smoothing == 0: if self.hparams.label_smoothing == 0:
# Same behavior as modeling_bart.py, besides ignoring pad_token_id # Same behavior as modeling_bart.py, besides ignoring pad_token_id
ce_loss_fct = torch.nn.CrossEntropyLoss(ignore_index=pad_token_id) ce_loss_fct = torch.nn.CrossEntropyLoss(ignore_index=pad_token_id)