Skip to content

Commit

Permalink
Fix score reference when using translation_from_pretrained_bart task
Browse files Browse the repository at this point in the history
Summary: `translation_from_pretrained_bart` task doesn't have `target_lang` variable. We need to access it through `args` like line 104.

Reviewed By: myleott

Differential Revision: D21369854

fbshipit-source-id: a405eb6525d2484c2a7a91e0db47def8ae203d30
  • Loading branch information
pipibjc authored and facebook-github-bot committed May 6, 2020
1 parent 89d18af commit a06083f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fairseq/tasks/translation_from_pretrained_bart.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def build_generator(self, models, args):
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
Expand Down

0 comments on commit a06083f

Please sign in to comment.