forked from hexo-ai/discover-train
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscore.py
More file actions
26 lines (17 loc) · 752 Bytes
/
Copy pathscore.py
File metadata and controls
26 lines (17 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""
Score a solution script against mle-bench.
Usage: python3 score.py solution.py [competition_id]
The solution must define a run() function that returns a DataFrame.
DATA_DIR is injected automatically.
"""
import sys, os, ray
os.environ["RAY_DEDUP_LOGS"] = "1"
os.environ["RAY_ENABLE_METRICS"] = "0"
ray.init(ignore_reinit_error=True, configure_logging=False)
from tinker_cookbook.recipes.ttt.env_mle_bench import verify_mle_bench
script = sys.argv[1]
comp = sys.argv[2] if len(sys.argv) > 2 else "spaceship-titanic"
with open(script) as f:
code = f"```python\n{f.read()}\n```"
result = verify_mle_bench(code, step=0, competition_id=comp)
print(f"score={result['raw_score']} medal={result['medal']} correctness={result['correctness']}")