From ff5cdc086be1e0c3e2bbad8e3469b34cffb55a85 Mon Sep 17 00:00:00 2001 From: Bhadresh Savani Date: Sat, 26 Jun 2021 17:31:25 +0100 Subject: [PATCH] replace print with logger (#12368) --- examples/pytorch/question-answering/utils_qa.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pytorch/question-answering/utils_qa.py b/examples/pytorch/question-answering/utils_qa.py index fef20639f0..1157849c99 100644 --- a/examples/pytorch/question-answering/utils_qa.py +++ b/examples/pytorch/question-answering/utils_qa.py @@ -413,14 +413,14 @@ def postprocess_qa_predictions_with_beam_search( output_dir, "null_odds.json" if prefix is None else f"{prefix}_null_odds.json" ) - print(f"Saving predictions to {prediction_file}.") + logger.info(f"Saving predictions to {prediction_file}.") with open(prediction_file, "w") as writer: writer.write(json.dumps(all_predictions, indent=4) + "\n") - print(f"Saving nbest_preds to {nbest_file}.") + logger.info(f"Saving nbest_preds to {nbest_file}.") with open(nbest_file, "w") as writer: writer.write(json.dumps(all_nbest_json, indent=4) + "\n") if version_2_with_negative: - print(f"Saving null_odds to {null_odds_file}.") + logger.info(f"Saving null_odds to {null_odds_file}.") with open(null_odds_file, "w") as writer: writer.write(json.dumps(scores_diff_json, indent=4) + "\n")