mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2025-10-09 13:40:09 +03:00
* init * fix tests * unify codeio * filtered for libraries not present in reasoning-gym * fix more bounds * puzzle24 * knight swap curriculum * fix number sorting * fix attributes * add validation of config in creation of dataset * dry run for instantiating and validating the datasets * remove unused imports * fix curriculum tests to reference newly updated attribute names
30 lines
900 B
Python
Executable File
30 lines
900 B
Python
Executable File
import argparse
|
|
|
|
from eval_config import EvalConfig
|
|
|
|
import reasoning_gym
|
|
|
|
|
|
def main():
|
|
argparser = argparse.ArgumentParser(description="Evaluate reasoning gym datasets.")
|
|
argparser.add_argument("--config", type=str, required=True, help="Path to the config file.")
|
|
args = argparser.parse_args()
|
|
|
|
config_path = args.config
|
|
if config_path.endswith(".yaml") or config_path.endswith(".yml"):
|
|
config = EvalConfig.from_yaml(config_path)
|
|
elif config_path.endswith(".json"):
|
|
config = EvalConfig.from_json(config_path)
|
|
else:
|
|
print("Error: Configuration file must be YAML or JSON")
|
|
return 1
|
|
|
|
for category in config.categories:
|
|
for dataset in category.datasets:
|
|
rg_dataset = reasoning_gym.create_dataset(dataset.dataset, size=10, seed=42, **dataset.params)
|
|
print(rg_dataset)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|