-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #184 from danmcp/unittests
Add make judge single test
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |