AlignBench
AlignBench copied to clipboard
fix: judgement and newline order corruption in multithreading
In judge.py, when multiple workers are set up, the output can sometimes be written out of order.
f.write(json.dumps(doc, ensure_ascii=False))
f.write('\n')
Specifically, when the judgement is written to the file in two separate f.write() operations, there's a chance that the content and the newline character (\n) may not be written sequentially.