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
...@@ -117,7 +117,7 @@ class BaseFairseqModel(nn.Module): ...@@ -117,7 +117,7 @@ class BaseFairseqModel(nn.Module):
self.apply(apply_make_generation_fast_) self.apply(apply_make_generation_fast_)
def train(mode): def train(mode=True):
if mode: if mode:
raise RuntimeError('cannot train after make_generation_fast') raise RuntimeError('cannot train after make_generation_fast')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment