From e1eab59aac9fdf5ebc062b1afe1d218d11d3a3d2 Mon Sep 17 00:00:00 2001 From: thomwolf Date: Thu, 13 Dec 2018 14:54:02 +0100 Subject: [PATCH] no fp16 on evaluation --- examples/run_classifier.py | 2 -- examples/run_squad.py | 2 -- examples/run_swag.py | 2 -- 3 files changed, 6 deletions(-) diff --git a/examples/run_classifier.py b/examples/run_classifier.py index ccb25bfcd8..e1dcd36344 100644 --- a/examples/run_classifier.py +++ b/examples/run_classifier.py @@ -558,8 +558,6 @@ def main(): # Load a trained model that you have fine-tuned model_state_dict = torch.load(output_model_file) model = BertForSequenceClassification.from_pretrained(args.bert_model, state_dict=model_state_dict) - if args.fp16: - model.half() model.to(device) if args.do_eval and (args.local_rank == -1 or torch.distributed.get_rank() == 0): diff --git a/examples/run_squad.py b/examples/run_squad.py index fb8cd8ddc6..d6e96f4ac9 100644 --- a/examples/run_squad.py +++ b/examples/run_squad.py @@ -923,8 +923,6 @@ def main(): # Load a trained model that you have fine-tuned model_state_dict = torch.load(output_model_file) model = BertForQuestionAnswering.from_pretrained(args.bert_model, state_dict=model_state_dict) - if args.fp16: - model.half() model.to(device) if args.do_predict and (args.local_rank == -1 or torch.distributed.get_rank() == 0): diff --git a/examples/run_swag.py b/examples/run_swag.py index 8d2ab40f88..bedfff0b13 100644 --- a/examples/run_swag.py +++ b/examples/run_swag.py @@ -478,8 +478,6 @@ def main(): model = BertForMultipleChoice.from_pretrained(args.bert_model, state_dict=model_state_dict, num_choices=4) - if args.fp16: - model.half() model.to(device) if args.do_eval and (args.local_rank == -1 or torch.distributed.get_rank() == 0):