From 357042f9b9d5ce3a413d1dae5b7cf9da02a4dd27 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Fri, 4 Dec 2020 14:07:22 -0800 Subject: [PATCH] Save checkpoints when do_eval = False Summary: We should save checkpoints if save_all_checkpoints is enabled, even if do_eval = False Reviewed By: snisarg Differential Revision: D25231046 fbshipit-source-id: 65a16b611cec5d93c65e6c4b5d29c45db295e6ee --- pytext/trainers/trainer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytext/trainers/trainer.py b/pytext/trainers/trainer.py index f66028a37..a1402b9d7 100644 --- a/pytext/trainers/trainer.py +++ b/pytext/trainers/trainer.py @@ -453,6 +453,8 @@ def train_from_state( self.run_epoch(state, epoch_data, metric_reporter) if not self.config.do_eval: + if train_config.save_all_checkpoints: + self.save_checkpoint(state, train_config) continue with timing.time("eval epoch"):