Spaces:
Running on Zero
Running on Zero
Download cell_fm/utils/dist_utils.py from BoHuangLab/CELL-FM: direct link, hf CLI and curl.
- Browser
- Download file 411 Bytes
-
https://huggingface.co/spaces/BoHuangLab/CELL-FM/resolve/main/cell_fm/utils/dist_utils.py
- Command line
-
hf download hf://spaces/BoHuangLab/CELL-FM/cell_fm/utils/dist_utils.py
-
curl -L -o dist_utils.py https://huggingface.co/spaces/BoHuangLab/CELL-FM/resolve/main/cell_fm/utils/dist_utils.py
411 Bytes
| # -*- coding: utf-8 -*- | |
| import os | |
| import torch | |
| def is_master_node(): | |
| if "RANK" not in os.environ or int(os.environ["RANK"]) == 0: | |
| return True | |
| else: | |
| return False | |
| def support_flash_attntion(): | |
| # check the GPU is A100 or H100 | |
| device_name = torch.cuda.get_device_name(0) | |
| for name in ["A100", "H100"]: | |
| if name in device_name: | |
| return True | |
| return False | |