MCPcopy Create free account
hub / github.com/FastMAS/KVCOMM / eval_loader

Function eval_loader

experiments/evaluate_mmlu.py:35–45  ·  view source on GitHub ↗
(batch_size: int)

Source from the content-addressed store, hash-verified

33 accuracy = Accuracy()
34
35 def eval_loader(batch_size: int) -> Iterator[List[Any]]:
36 records: List[Any] = []
37 for i_record, record in enumerate(dataset):
38 if limit_questions is not None and i_record >= limit_questions:
39 break
40 records.append(record)
41 if len(records) >= batch_size:
42 yield records
43 records = []
44 if records:
45 yield records
46
47 data_len = min(len(dataset), limit_questions) if limit_questions is not None else len(dataset)
48 num_batches = int(math.ceil(data_len / eval_batch_size))

Callers 1

evaluateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected