Skip to content

Support current-directory output files in MT-bench - #3940

Open
j45856021-dev wants to merge 1 commit into
lm-sys:mainfrom
j45856021-dev:fix/judge-output-bare-filenames
Open

j45856021-dev wants to merge 1 commit into
lm-sys:mainfrom
j45856021-dev:fix/judge-output-bare-filenames

Conversation

@j45856021-dev

Copy link
Copy Markdown

Why are these changes needed?

Using --answer-file answers.jsonl fails after answer generation because os.path.dirname("answers.jsonl") is empty and os.makedirs("") raises FileNotFoundError. The single and pairwise judgment writers have the same issue when called with a bare output filename.

Use the current directory when there is no parent path. This changes only the four directory-creation calls; nested paths still create their parent directories, and JSONL output stays unchanged. Document the answer-file override.

The offline regression tests invoke all four real writer paths with API/model generation and CUDA transfer mocked. Before the fix, all four bare-filename cases fail; the four nested-directory controls pass. After the fix, all eight cases pass, including answer-file reorganization and saved result fields.

Checks

  • python -m unittest discover -s tests -p test_llm_judge_output_files.py -v: 4 tests passed, covering 8 writer/path combinations.
  • Black 23.3.0 checks pass for all changed Python files.
  • Pylint 2.8.2 passes for the new test module.
  • Ran format.sh --files .... Its repository-wide Pylint step fails with the same 886 diagnostics on both this change and the untouched base 587d5cf; there are no added diagnostics.
  • git diff --check passes. The new test file also parses with Python 3.8 syntax rules.

Validation ran on Python 3.10. No model weights, remote completions, or GPU inference were used.

Handle an empty parent path consistently in API/local answer generation and single/pairwise judgment output. Preserve nested directory creation and add offline regression coverage for all four writers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant