From c888663f18673003574cffe9608c5aae2bc9ccff Mon Sep 17 00:00:00 2001 From: thomwolf Date: Mon, 24 Jun 2019 14:38:24 +0200 Subject: [PATCH] overwrite output directories if needed --- examples/run_bert_classifier.py | 2 +- examples/run_bert_squad.py | 2 +- examples/run_xlnet_classifier.py | 2 +- examples/run_xlnet_squad.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/run_bert_classifier.py b/examples/run_bert_classifier.py index cc8d1fe571..8bb37159d3 100644 --- a/examples/run_bert_classifier.py +++ b/examples/run_bert_classifier.py @@ -186,7 +186,7 @@ def main(): raise ValueError("At least one of `do_train` or `do_eval` must be True.") if os.path.exists(args.output_dir) and os.listdir(args.output_dir) and args.do_train and not args.overwrite_output_dir: - raise ValueError("Output directory ({}) already exists and is not empty.".format(args.output_dir)) + raise ValueError("Output directory ({}) already exists and is not empty. Use --overwrite_output_dir to overcome.".format(args.output_dir)) if not os.path.exists(args.output_dir) and args.local_rank in [-1, 0]: os.makedirs(args.output_dir) diff --git a/examples/run_bert_squad.py b/examples/run_bert_squad.py index c0e7844236..b35a9175ec 100644 --- a/examples/run_bert_squad.py +++ b/examples/run_bert_squad.py @@ -179,7 +179,7 @@ def main(): "If `do_predict` is True, then `predict_file` must be specified.") if os.path.exists(args.output_dir) and os.listdir(args.output_dir) and args.do_train and not args.overwrite_output_dir: - raise ValueError("Output directory () already exists and is not empty.") + raise ValueError("Output directory {} already exists and is not empty. Use --overwrite_output_dir to overcome.".format(args.output_dir)) if not os.path.exists(args.output_dir): os.makedirs(args.output_dir) diff --git a/examples/run_xlnet_classifier.py b/examples/run_xlnet_classifier.py index 758c96c67d..6733a25573 100644 --- a/examples/run_xlnet_classifier.py +++ b/examples/run_xlnet_classifier.py @@ -151,7 +151,7 @@ def main(): raise ValueError("At least one of `do_train` or `do_eval` must be True.") if os.path.exists(args.output_dir) and os.listdir(args.output_dir) and args.do_train and not args.overwrite_output_dir: - raise ValueError("Output directory ({}) already exists and is not empty.".format(args.output_dir)) + raise ValueError("Output directory ({}) already exists and is not empty. Use --overwrite_output_dir to overcome.".format(args.output_dir)) if not os.path.exists(args.output_dir) and args.local_rank in [-1, 0]: os.makedirs(args.output_dir) diff --git a/examples/run_xlnet_squad.py b/examples/run_xlnet_squad.py index b01bf82a55..a72d648ff7 100644 --- a/examples/run_xlnet_squad.py +++ b/examples/run_xlnet_squad.py @@ -179,7 +179,7 @@ def main(): "If `do_predict` is True, then `predict_file` must be specified.") if os.path.exists(args.output_dir) and os.listdir(args.output_dir) and args.do_train and not args.overwrite_output_dir: - raise ValueError("Output directory () already exists and is not empty.") + raise ValueError("Output directory {} already exists and is not empty. Use --overwrite_output_dir to overcome.".format(args.output_dir)) if not os.path.exists(args.output_dir): os.makedirs(args.output_dir)