rabukasim / tools /debug /get_log_path.py
trioskosmos's picture
chore: remove large files for HF Space
9bd4ce5
import os
from pathlib import Path
log_dir = Path("alphazero/logs/loops")
files = sorted(log_dir.glob("*.txt"), key=os.path.getmtime, reverse=True)
if files:
with open("tmp_latest_log_path.txt", "w") as f:
f.write(str(files[0].absolute()))
print(f"Path written: {files[0].name}")
else:
print("No log files found.")