tahamajs's picture
download
raw
670 Bytes
import logging
from pytorch_lightning.utilities import rank_zero_only
def get_pylogger(name=__name__) -> logging.Logger:
"""Initializes multi-GPU-friendly python command line logger."""
logger = logging.getLogger(name)
# this ensures all logging levels get marked with the rank zero decorator
# otherwise logs would get multiplied for each GPU process in multi-GPU setup
logging_levels = (
"debug",
"info",
"warning",
"error",
"exception",
"fatal",
"critical",
)
for level in logging_levels:
setattr(logger, level, rank_zero_only(getattr(logger, level)))
return logger

Xet Storage Details

Size:
670 Bytes
·
Xet hash:
ecc342e95f8eb6a6107a9e5ffec921c0d3658ea93f5703031ce5ca8534459f27

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