Skip to content

Commit

Permalink
Merge pull request #184 from danmcp/unittests
Browse files Browse the repository at this point in the history
Add make judge single test
  • Loading branch information
mergify[bot] authored Dec 4, 2024
2 parents 046275f + 8989788 commit e5d89c6
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/test_mt_bench_judgment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SPDX-License-Identifier: Apache-2.0

# Standard
import os

# First Party
from instructlab.eval.mt_bench_common import Judge
from instructlab.eval.mt_bench_judgment import load_judge_prompts, make_judge_single


def test_make_judge_single():
judge_file = os.path.join(
os.path.dirname(__file__),
"..",
"src",
"instructlab",
"eval",
"data",
"mt_bench",
"judge_prompts.jsonl",
)
judge_prompts = load_judge_prompts(judge_file)
judges = make_judge_single("prometheus-8x7b-v2-0", judge_prompts)
assert len(judges) == 4
assert isinstance(judges["default"], Judge)
assert isinstance(judges["math"], Judge)
assert judges["math"].ref_based
assert isinstance(judges["default-mt"], Judge)
assert judges["default-mt"].multi_turn
assert isinstance(judges["math-mt"], Judge)
assert judges["math-mt"].ref_based
assert judges["math-mt"].multi_turn

0 comments on commit e5d89c6

Please sign in to comment.