Skip to content

Commit 09088fd

Browse files
committed
2 parents cdcde62 + d719f1c commit 09088fd

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

eval_protocol/utils/evaluation_row_utils.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from typing import List
1010

1111
from eval_protocol.models import EvaluationRow, Message
12+
from eval_protocol.models import InputMetadata
1213

1314

1415
def serialize_message(msg: Message) -> str:
@@ -134,3 +135,24 @@ def assistant_to_ground_truth(data: List[EvaluationRow]) -> List[EvaluationRow]:
134135
)
135136

136137
return processed_rows
138+
139+
140+
def create_rows_from_indices(count: int, **metadata) -> List[EvaluationRow]:
141+
"""Create evaluation rows with sequential row_ids.
142+
Useful for remote processors where the server determines content based on row_id.
143+
Args:
144+
count: Number of rows to create
145+
**metadata: Additional metadata to include in each row
146+
Returns:
147+
List of EvaluationRows with row_id set to "0", "1", "2", ...
148+
"""
149+
rows = []
150+
for idx in range(count):
151+
row_metadata = {**metadata, "row_id": str(idx)}
152+
rows.append(
153+
EvaluationRow(
154+
messages=[],
155+
input_metadata=InputMetadata(**row_metadata),
156+
)
157+
)
158+
return rows

0 commit comments

Comments
 (0)