File size: 638 Bytes
9448234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import json
from pathlib import Path

# Oracle: reproduce the ground truth. Replace this with a real
# computation (ase / rdkit / mace / tblite) that derives the answer
# from scratch — it must match your ground truth.
queries = json.loads(Path("/root/data/queries.json").read_text())
answers = []
for q in queries:
    answers.append({
        "id": q["id"],
        "category": q.get("category", ""),
        "query": q["query"],
        "answer": {"structured_output": {"smiles": ["O=S=O"]}},
    })
Path("/root/results").mkdir(parents=True, exist_ok=True)
Path("/root/results/answers.json").write_text(json.dumps(answers, indent=2))