replace print with logger (#12368)
This commit is contained in:
@@ -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"
|
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:
|
with open(prediction_file, "w") as writer:
|
||||||
writer.write(json.dumps(all_predictions, indent=4) + "\n")
|
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:
|
with open(nbest_file, "w") as writer:
|
||||||
writer.write(json.dumps(all_nbest_json, indent=4) + "\n")
|
writer.write(json.dumps(all_nbest_json, indent=4) + "\n")
|
||||||
if version_2_with_negative:
|
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:
|
with open(null_odds_file, "w") as writer:
|
||||||
writer.write(json.dumps(scores_diff_json, indent=4) + "\n")
|
writer.write(json.dumps(scores_diff_json, indent=4) + "\n")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user