AlignBench icon indicating copy to clipboard operation
AlignBench copied to clipboard

fix: judgement and newline order corruption in multithreading

Open Azure99 opened this issue 1 year ago • 0 comments

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.

Azure99 avatar Aug 16 '24 09:08 Azure99