CICD / patch_test_inference.py
printf-sourav's picture
Expose independent grader scores in the reward calculator component models
05feb67
Raw
History Blame Contribute Delete
578 Bytes
with open("tests/test_inference.py", "r") as f:
code = f.read()
code = code.replace(
r"^\[STEP\] step=\d+ action=.* reward=-?\d+\.\d{2} done=(true|false) error=(null|.+)$",
r"^\[STEP\] step=\d+ action=.* reward=-?\d+\.\d{3} done=(true|false) error=(null|.+)$"
)
code = code.replace(
r"^\[END\] success=(true|false) steps=\d+ score=\d+\.\d{3} rewards=(-?\d+\.\d{2}(,-?\d+\.\d{2})*)?$",
r"^\[END\] success=(true|false) steps=\d+ score=\d+\.\d{3} rewards=(-?\d+\.\d{3}(,-?\d+\.\d{3})*)?$"
)
with open("tests/test_inference.py", "w") as f:
f.write(code)