From b8cacb0e75ccfc5c05bf9fb954735e99a664414b Mon Sep 17 00:00:00 2001 From: Henderake Date: Sun, 19 Mar 2017 08:11:07 +0800 Subject: [PATCH] Switch the model to evaluation mode before generation --- word_language_model/generate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/word_language_model/generate.py b/word_language_model/generate.py index 471645f284..22fe5bcf19 100644 --- a/word_language_model/generate.py +++ b/word_language_model/generate.py @@ -46,6 +46,7 @@ with open(args.checkpoint, 'rb') as f: model = torch.load(f) +model.eval() if args.cuda: model.cuda()