Skip to content

Commit 1b8032d

Browse files
committed
add tests
1 parent a439e76 commit 1b8032d

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

eval_protocol/pytest/evaluation_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ async def execute_with_params(
403403
# Calculate all possible combinations of parameters
404404
if mode == "groupwise":
405405
combinations = generate_parameter_combinations(
406-
input_dataset, None, input_dataset, evaluation_test_kwargs, max_dataset_rows, combine_datasets
406+
input_dataset, None, input_messages, evaluation_test_kwargs, max_dataset_rows, combine_datasets
407407
)
408408
else:
409409
combinations = generate_parameter_combinations(
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from typing import List
2+
3+
from eval_protocol.models import EvaluationRow, Message, EvaluateResult
4+
from eval_protocol.pytest import SingleTurnRolloutProcessor, evaluation_test
5+
6+
@evaluation_test(
7+
input_messages=[
8+
[
9+
Message(role="user", content="What is the capital of France?"),
10+
]
11+
],
12+
completion_params=[
13+
{"model": "fireworks_ai/accounts/fireworks/models/gpt-oss-120b"},
14+
{"model": "fireworks_ai/accounts/fireworks/models/gpt-4.1"},
15+
],
16+
rollout_processor=SingleTurnRolloutProcessor(),
17+
mode="groupwise",
18+
)
19+
def test_pytest_groupwise(rows: List[EvaluationRow]) -> List[EvaluationRow]:
20+
"""Run math evaluation on sample dataset using pytest interface."""
21+
assert rows[0].input_metadata.completion_params["model"] == "fireworks_ai/accounts/fireworks/models/gpt-oss-120b"
22+
assert rows[1].input_metadata.completion_params["model"] == "fireworks_ai/accounts/fireworks/models/gpt-4.1"
23+
rows[0].evaluation_result = EvaluateResult(score=1.0, reason="test")
24+
rows[1].evaluation_result = EvaluateResult(score=0.0, reason="test")
25+
print(rows[0].model_dump_json())
26+
print(rows[1].model_dump_json())
27+
return rows

0 commit comments

Comments
 (0)