MCPcopy
hub / github.com/FareedKhan-dev/train-llm-from-scratch / log

Method log

src/post_training/logging_utils.py:46–51  ·  view source on GitHub ↗
(self, step: int, metrics: dict[str, Any])

Source from the content-addressed store, hash-verified

44 print(f"[logger] stage={stage} -> {self.path}")
45
46 def log(self, step: int, metrics: dict[str, Any]) -> None:
47 record = {"step": step, "wall": time.time(), **metrics}
48 self._fh.write(json.dumps(record) + "\n")
49 self._fh.flush()
50 if self._wandb is not None:
51 self._wandb.log(metrics, step=step)
52
53 def close(self) -> None:
54 try:

Callers 7

mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
_log1mexpFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected