Download utils/distributed_utils.py from BonanDing/DeMemWM: direct link, hf CLI and curl.
- Browser
- Download file 150 Bytes
-
https://huggingface.co/BonanDing/DeMemWM/resolve/main/utils/distributed_utils.py
- Command line
-
hf download hf://BonanDing/DeMemWM/utils/distributed_utils.py
-
curl -L -o distributed_utils.py https://huggingface.co/BonanDing/DeMemWM/resolve/main/utils/distributed_utils.py
150 Bytes
| import os | |
| def process_rank() -> int: | |
| return int(os.environ.get("RANK", os.environ.get("SLURM_PROCID", 0))) | |
| is_rank_zero = process_rank() == 0 | |