Buckets:

|
download
raw
1.33 kB

Logging[[accelerate.logging.get_logger]]

Refer to the Troubleshooting guide or to the example below to learn how to use Accelerate's logger.

accelerate.logging.get_logger[[accelerate.logging.get_logger]]

Source

Returns a logging.Logger for name that can handle multiprocessing.

If a log should be called on all processes, pass main_process_only=False If a log should be called on all processes and in order, also pass in_order=True

Example:

>>> from accelerate.logging import get_logger
>>> from accelerate import Accelerator

>>> logger = get_logger(__name__)

>>> accelerator = Accelerator()
>>> logger.info("My log", main_process_only=False)
>>> logger.debug("My log", main_process_only=True)

>>> logger = get_logger(__name__, log_level="DEBUG")
>>> logger.info("My log")
>>> logger.debug("My second log")

>>> array = ["a", "b", "c", "d"]
>>> letter_at_rank = array[accelerator.process_index]
>>> logger.info(letter_at_rank, in_order=True)

Parameters:

name (str) : The name for the logger, such as __file__

log_level (str, optional) : The log level to use. If not passed, will default to the LOG_LEVEL environment variable, or INFO if not

Xet Storage Details

Size:
1.33 kB
·
Xet hash:
3efe4b414f0c99d227ad31a4690ad7226c7487594a699833d58b9b4eda94360c

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