Spaces:
Configuration error
Configuration error
Download utils/distributed_utils.py from KempnerInstituteAI/LVP: direct link, hf CLI and curl.
- Browser
- Download file 271 Bytes
-
https://huggingface.co/spaces/KempnerInstituteAI/LVP/resolve/main/utils/distributed_utils.py
- Command line
-
hf download hf://spaces/KempnerInstituteAI/LVP/utils/distributed_utils.py
-
curl -L -o distributed_utils.py https://huggingface.co/spaces/KempnerInstituteAI/LVP/resolve/main/utils/distributed_utils.py
271 Bytes
| import wandb | |
| from typing import Callable | |
| import torch | |
| import torch.distributed as dist | |
| from lightning.pytorch.utilities.rank_zero import rank_zero_only | |
| is_rank_zero = wandb.run is not None | |
| is_rank_zero = rank_zero_only.rank == 0 | |
| rank_zero_print = rank_zero_only(print) | |