replace print with logger (#12368)

This commit is contained in:
Bhadresh Savani 2021-06-26 17:31:25 +01:00 committed by GitHub
parent 9a7545943d
commit ff5cdc086b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")