Skip to content

Commit e5d89c6

Browse files
authored
Merge pull request #184 from danmcp/unittests
Add make judge single test
2 parents 046275f + 8989788 commit e5d89c6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/test_mt_bench_judgment.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# Standard
4+
import os
5+
6+
# First Party
7+
from instructlab.eval.mt_bench_common import Judge
8+
from instructlab.eval.mt_bench_judgment import load_judge_prompts, make_judge_single
9+
10+
11+
def test_make_judge_single():
12+
judge_file = os.path.join(
13+
os.path.dirname(__file__),
14+
"..",
15+
"src",
16+
"instructlab",
17+
"eval",
18+
"data",
19+
"mt_bench",
20+
"judge_prompts.jsonl",
21+
)
22+
judge_prompts = load_judge_prompts(judge_file)
23+
judges = make_judge_single("prometheus-8x7b-v2-0", judge_prompts)
24+
assert len(judges) == 4
25+
assert isinstance(judges["default"], Judge)
26+
assert isinstance(judges["math"], Judge)
27+
assert judges["math"].ref_based
28+
assert isinstance(judges["default-mt"], Judge)
29+
assert judges["default-mt"].multi_turn
30+
assert isinstance(judges["math-mt"], Judge)
31+
assert judges["math-mt"].ref_based
32+
assert judges["math-mt"].multi_turn

0 commit comments

Comments
 (0)