From 639f4b7190e03caecfa4465cb7e2d7d9f8d13be5 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Thu, 10 Oct 2019 19:17:25 +0000 Subject: [PATCH] Don't save/load when on TPU --- examples/run_glue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_glue.py b/examples/run_glue.py index a2167ed807..45924c9290 100644 --- a/examples/run_glue.py +++ b/examples/run_glue.py @@ -494,7 +494,7 @@ def main(): # Saving best-practices: if you use defaults names for the model, you can reload it using from_pretrained() - if args.do_train and (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) and not args.tpu: # 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)