Add header and fix command (#5082)

This commit is contained in:
Sylvain Gugger
2020-06-17 11:45:05 -04:00
committed by GitHub
parent 70bc3ead4f
commit cd40f6564e
2 changed files with 2 additions and 1 deletions

View File

@@ -216,6 +216,7 @@ def main():
output_eval_file = os.path.join(training_args.output_dir, "hans_predictions.txt")
if trainer.is_world_master():
with open(output_eval_file, "w") as writer:
writer.write("pairID,gold_label\n")
for pid, pred in zip(pair_ids, preds):
writer.write("ex" + str(pid) + "," + label_list[int(pred)] + "\n")