INNER CODE UNIT · Python
run
i3T4AN/KADATH · kadath/cli.py:284
def run() -> None:
try: result["count"] = kernel.run(run_id, epochs)
except BaseException as exc: result["error"] = exc
thread = threading.Thread(target=run, daemon=True)
thread.start()
interactive = sys.stdout.isatty()
while thread.is_alive():
output = _render_dashboard(kernel.status(run_id), styled=interactive)
print(("\033[H\033[2J" if interactive else "") + output, flush=True)
thread.join(.75)
if "error" in result:
raise result["error"]
return int(result["count"])
if __name__ == "__main__":
main()