Skip to content

Commit

Permalink
Add run_id to final_report from LocalRecorder (openai#1452)
Browse files Browse the repository at this point in the history
(Not an eval)

The `final_report` log line currently doesn't include the `run_id`,
which means that if we want to work out which run it belongs to, we have
to look at the `run_id` of other log lines in the same file. This makes
it a bit harder to work with the logs, and as far as I can tell there's
no downside to including the `run_id`.
  • Loading branch information
ianmckenzie-oai committed Jan 26, 2024
1 parent c66b5c1 commit cf002f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion evals/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def _flush_events_internal(self, events_to_write: Sequence[Event]):

def record_final_report(self, final_report: Any):
with bf.BlobFile(self.event_file_path, "ab") as f:
f.write((jsondumps({"final_report": final_report}) + "\n").encode("utf-8"))
f.write((jsondumps({"final_report": final_report, "run_id": self.run_spec.run_id}) + "\n").encode("utf-8"))

logging.info(f"Final report: {final_report}. Logged to {self.event_file_path}")

Expand Down

0 comments on commit cf002f2

Please sign in to comment.