twanghcmut's picture
download
raw
690 Bytes
import logging
import time
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
DATA = ROOT / "data"
OUTPUTS = ROOT / "outputs"
LOGS = ROOT / "logs"
def start_run(name):
stamp = time.strftime("%Y%m%d_%H%M%S")
out = OUTPUTS / name / stamp
out.mkdir(parents=True, exist_ok=True)
LOGS.mkdir(parents=True, exist_ok=True)
log = logging.getLogger(f"{name}_{stamp}")
log.setLevel(logging.INFO)
fmt = logging.Formatter("%(asctime)s %(message)s")
for handler in (
logging.FileHandler(LOGS / f"{name}_{stamp}.log"),
logging.StreamHandler(),
):
handler.setFormatter(fmt)
log.addHandler(handler)
return out, log

Xet Storage Details

Size:
690 Bytes
·
Xet hash:
bc9f9dbe422adeb6df155605f6b619e23af1183581d22e0fecdb3e93edd8c62a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.