Download shared/radial_attention/utils.py from 1ripon1/ColabWan: direct link, hf CLI and curl.
- Browser
- Download file 379 Bytes
-
https://huggingface.co/spaces/1ripon1/ColabWan/resolve/main/shared/radial_attention/utils.py
- Command line
-
hf download hf://spaces/1ripon1/ColabWan/shared/radial_attention/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/1ripon1/ColabWan/resolve/main/shared/radial_attention/utils.py
379 Bytes
| import os | |
| import random | |
| import numpy as np | |
| import torch | |
| def set_seed(seed): | |
| """ | |
| Set the random seed for reproducibility. | |
| """ | |
| random.seed(seed) | |
| os.environ['PYTHONHASHSEED'] = str(seed) | |
| np.random.seed(seed) | |
| torch.manual_seed(seed) | |
| torch.cuda.manual_seed(seed) | |
| torch.backends.cudnn.deterministic = True | |
| torch.backends.cudnn.benchmark = False |