Fix score reference when using translation_from_pretrained_bart task
Summary: `translation_from_pretrained_bart` task doesn't have `target_lang` variable. We need to access it through `args` like line 104.
@@ -84,7 +84,7 @@ class TranslationFromPretrainedBARTTask(TranslationTask):
from fairseq.sequence_scorer import SequenceScorer
return SequenceScorer(
self.target_dictionary,
- eos=self.tgt_dict.index('[{}]'.format(self.target_lang))
+ eos=self.tgt_dict.index('[{}]'.format(self.args.target_lang))
)
else:
from fairseq.sequence_generator import SequenceGenerator
