Skip to content

registry

registry

registry.py Decorator-based registry for jobs, datasets, and evaluations.

Usage

from theseus.registry import job, dataset, evaluation

@job("gpt/train/pretrain") class PretrainGPT(BaseTrainer[...]): ...

@dataset("alpaca") class Alpaca(ChatTemplateDataset): ...

@evaluation("bbq") class BBQEval(RolloutEvaluation): ...

job(key: str) -> Callable[[T], T]

Register a job class under the given key.

dataset(key: str) -> Callable[[T], T]

Register a dataset class under the given key.

evaluation(key: str) -> Callable[[T], T]

Register an evaluation callable under the given key.