Skip to content

Evaluation

Score saved predictions on CPU with EvalKit.

EvalKit maintains versioned evaluation protocols, scoring, and the prediction generation loop. Scoring runs on CPU and needs neither torch, transformers, nor network access — only Python 3.12 and uv.

EvalKit registers all nine published task protocols, with SciTS NEU06 as the worked end-to-end example below.

Registered datasets

Dataset IDTaskProtocolOptional runtime extras
scits-neu06SciTS NEU06scits-neu06-v1none (stdlib)
scits-phu01SciTS PHU01scits-classification-text-3dp-ecg100hz-v1none (stdlib)
llm4mat-jarvisJARVIS-DFTllm4mat-jarvis-formation-energy-cif-v1none (stdlib)
qm9s-allspectraQM9Sdiffspectra-compute-metrics-v1rdkit, myopic-mces, pulp (for molecular scoring)
atom3d-psrATOM3D PSRatom3d-psr-year-backbone-text-gdt-ts-v2scipy (lmdb only for raw LMDB input extraction)
gue-spliceGUE splicegue-splice-reconstructed-mcc-v1none (stdlib)
beacon-ncrnaBEACON ncRNAbeacon-rna-bioinstructions-v1none (stdlib)
mpbind-ba1MPBindmpbind-ppi-reconstructed-ba1-sequence-sites-v1none (stdlib)
simxrd-olSimXRD OLsimxrd-ol-crystal7-text-maxbin0.1deg-v1none (stdlib)

Score saved predictions

Run from the repository root:

SCITS=/path/to/SciTS      # OpenTSLab/SciTS at revision 6ce690e904898cc8fd9014ea2e5bebdfa749c1d2
RUN=/path/to/neu06-run    # holds responses.jsonl

uvx --from huggingface-hub hf download OpenTSLab/SciTS meta_data.jsonl --repo-type dataset \
  --revision 6ce690e904898cc8fd9014ea2e5bebdfa749c1d2 --local-dir "$SCITS"
uv run --project evalkit scip-eval score --task scits-neu06 \
  --references "$SCITS/meta_data.jsonl" --responses "$RUN/responses.jsonl" --out-dir "$RUN/score"

--dataset is accepted as an alias for --task, and --workers sets worker processes for datasets with parallel metrics such as qm9s-allspectra. The command prints a summary and writes summary.json and per-item scores.jsonl to --out-dir. The library entry point is evalkit.score.score_files(task, references, responses, *, only_responded=False, workers=1).

By default every frozen ID is scored, and an ID with no prediction counts as an empty answer. --only-responded scores only the IDs that have a prediction record, and marks the result as a subset.

Prediction file format

  • Each JSONL line is one attempt, with eval_id, content, and optionally status (ok, truncated, api_error). Other fields are ignored. For a repeated eval_id, the last line wins.
  • generation.run writes a run_id into every line and a <filename>.run.json next to it, recording the run identity: task, ordered inputs, model, service address and model name, decoding parameters. A run with the same identity can resume and skip the IDs already written; a different identity writing to the same file is refused.
  • Only one generation process may use a path at a time, enforced by <filename>.lock. A stale lock left by an abnormal exit must be removed by hand.
  • Older files without a run_id still score normally, but cannot be appended to; write the remaining items to a new file.

The scits-neu06-v1 protocol

ItemDefinition
Test setThe 1,024 rows of SciTS meta_data.jsonl whose task_id contains NEU06, with eval_id = "NEU06:" + id. Row count and the SHA-256 of [eval_id, label] are checked on load
ClassesWake, N1, N2, N3, REM, with support 324, 101, 365, 94, 140
Answer parsingTake the body after the last </think>; if <answer>…</answer> is present, take the last one; strip the outer code fence. A line equal to a class name predicts that class
ValidityValid when there is at least one line and every line is a class name. Validity is reported separately and does not clear the prediction: N2 plus a line unsure is invalid but still predicts N2
Missing and statusA missing ID scores as an empty answer; status is reported only and does not affect parsing
Macro-F1The mean F1 over the reference classes present in the scored rows; TP/FP/FN count label-set membership
AccuracyThe predicted label set equals the reference set

Parsing and scoring follow the rules used for the Sage-SciPerception v0.1.0 published scores.

Reproduce from raw EEG

The NEU06 example covers the full path: REVE-base feature extraction, generation against a vLLM server, and scoring. It lists every input with its source, revision, and license, and reports both the released run and a rerun:

RunMacro-F1 (%)Accuracy (%)
Released (v0.1.0)72.0176.46
Rerun71.8276.46

Both runs cover all 1,024 items. They are separate runs, and per-item predictions of the released run are not available.

Add a dataset or a model

ModuleResponsibility
datasets/base.pyThe small base class EvalDataset: name, protocol, load, metadata, score_items, score aligned by eval_id, and shared answer_span
datasets/<suite>.pyOne module (or package such as datasets/qm9s/) per upstream dataset or benchmark suite, holding references, questions, parsing and metrics; tasks within a suite register by task ID
datasets/__init__.pyThe DATASETS registry
contract.py, score.py, cli.pyPrediction file reading, score dispatch, result writing, and scip-eval score
generation.pyThe generation loop: concurrency, OpenAI-compatible /completions requests recording http_status, run-bound appends and resume
glm_prompt_embeds.pyThe vLLM prompt_embeds adapters (GlmProjectorPrompt and reusable variable-length GlmProjectorSession) for GLM plus a projector payload across the nine atom projector modalities, with multi-object support, atom_numbering/payload_labels and optional discrete/side/counts passthrough; needs torch, transformers and safetensors at run time

A new dataset or task: implement an EvalDataset subclass in a suite module, register it in datasets/__init__.py, and add fixtures under tests/. Dispatch and the CLI need no change.

A new model: a model called the same way needs only different weights, configuration and service name in the calling script. A different calling convention adds an adapter module that assembles the request and states the model identity, combined with generation.completion or your own transport into a generate(eval_id) passed to generation.run.