From a368b877911862da014ed7b219679effbb8dd8ca Mon Sep 17 00:00:00 2001 From: Peng Qi Date: Mon, 19 Aug 2019 13:07:00 -0700 Subject: [PATCH 1/2] Fix #1015 --- 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 f2d29fd6b1..efa835107c 100644 --- a/examples/run_squad.py +++ b/examples/run_squad.py @@ -498,7 +498,7 @@ def main(): # Load a trained model and vocabulary that you have fine-tuned model = model_class.from_pretrained(args.output_dir) - tokenizer = tokenizer_class.from_pretrained(args.output_dir) + tokenizer = tokenizer_class.from_pretrained(args.output_dir, do_lower_case=args.do_lower_case) model.to(args.device) From 3bffd2e8e5d726d581e0a66746b25c64d49e231d Mon Sep 17 00:00:00 2001 From: Peng Qi Date: Tue, 20 Aug 2019 10:59:28 -0700 Subject: [PATCH 2/2] more fixes --- examples/run_glue.py | 2 +- examples/run_squad.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/run_glue.py b/examples/run_glue.py index 7fb0732e61..1729f4f7e3 100644 --- a/examples/run_glue.py +++ b/examples/run_glue.py @@ -467,7 +467,7 @@ def main(): # Load a trained model and vocabulary that you have fine-tuned model = model_class.from_pretrained(args.output_dir) - tokenizer = tokenizer_class.from_pretrained(args.output_dir) + tokenizer = tokenizer_class.from_pretrained(args.output_dir, do_lower_case=args.do_lower_case) model.to(args.device) diff --git a/examples/run_squad.py b/examples/run_squad.py index efa835107c..c0586b03bd 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.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): # 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)