Commit 58b912f6 authored by Xian Li's avatar Xian Li Committed by Facebook Github Bot
Browse files

Fix sacrebleu (#630)

Summary:
Pull Request resolved: https://github.com/pytorch/fairseq/pull/630

sacrebleu scorer has stopped working in pytorch_translate (maybe
fairseq too) probably due to  a recent api change.

Reviewed By: jmp84

Differential Revision: D14792797

fbshipit-source-id: c2a00246e08bc913c41e60c5fbf8ab4ab5e80d18
parent e5ba94ab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ class SacrebleuScorer(object):
        self.sys.append(pred)

    def score(self, order=4):
        return self.result_string(order).bleu
        return self.result_string(order).score

    def result_string(self, order=4):
        if order != 4: