mirror of
https://github.com/microsoft/SkillOpt.git
synced 2026-07-03 14:02:58 +08:00
Benchmark Template
This directory provides scaffold files for adding a new benchmark to SkillOpt.
Files
env_template.py— Environment adapter template (subclassesEnvAdapter; implements the 4 abstract methods so the file is instantiable out of the box —reflectis inherited).loader_template.py— Data loader template (subclassesSplitDataLoader; implementsload_split_itemsfor.json/.jsonl).config_template.yaml— Config file template.
Usage
- Copy the directory:
cp -r skillopt/envs/_template skillopt/envs/your_benchmark - Rename the files (drop the
_templatesuffix):…and inside each file rename the classes (cd skillopt/envs/your_benchmark mv env_template.py adapter.py mv loader_template.py dataloader.pyTemplateBenchmarkEnv → YourBenchmarkAdapter,TemplateBenchmarkLoader → YourBenchmarkLoader) and fix the cross-import inadapter.py. - Implement the TODO blocks inside
adapter.py:rolloutand the_normalize_itemhelper indataloader.py. (reflectis inherited fromEnvAdapter; override it only for custom reflection logic.) - Register the adapter — add a
try / except ImportErrorblock inscripts/train.py's_register_builtins()mapping the registry key to yourYourBenchmarkAdapterclass. There is noBENCHMARK_REGISTRYdict inskillopt/envs/__init__.py; the live registry is_ENV_REGISTRYinscripts/train.py. - Create the config at
configs/your_benchmark/default.yaml(start fromconfig_template.yaml)._base_is a string path, not a list.
See the Add a New Benchmark guide
for the full step-by-step with a worked docfaithful example.