Commit 315fa5cb authored by Wei Ho's avatar Wei Ho Committed by Facebook Github Bot
Browse files

Make error message for trying to train after make_generation_fast work correctly

Summary: https://github.com/pytorch/fairseq/blob/master/fairseq/trainer.py#L164 calls `train()` without any argument

Reviewed By: myleott

Differential Revision: D13599203

fbshipit-source-id: 3a096a6dd35a7a3f8309fbda3b54a36f606475e3
parent 4b1f4788
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ class BaseFairseqModel(nn.Module):

        self.apply(apply_make_generation_fast_)

        def train(mode):
        def train(mode=True):
            if mode:
                raise RuntimeError('cannot train after make_generation_fast')