From 40acf6b52a5250608c2b90edd955835131971d5a Mon Sep 17 00:00:00 2001 From: Chi-Liang Liu Date: Tue, 30 Jul 2019 18:37:37 +0800 Subject: [PATCH] don't save model without training --- examples/run_squad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_squad.py b/examples/run_squad.py index f0ae9169ad..f2d29fd6b1 100644 --- a/examples/run_squad.py +++ b/examples/run_squad.py @@ -481,7 +481,7 @@ def main(): # Save the trained model and the tokenizer - if args.local_rank == -1 or torch.distributed.get_rank() == 0: + if args.do_train and args.local_rank == -1 or torch.distributed.get_rank() == 0: # Create output directory if needed if not os.path.exists(args.output_dir) and args.local_rank in [-1, 0]: os.makedirs(args.output_dir)