Spaces:
Build error
Build error
Download utils/fixseed.py from Hemanth0004/Momask-Demo-Project: direct link, hf CLI and curl.
- Browser
- Download file 351 Bytes
-
https://huggingface.co/spaces/Hemanth0004/Momask-Demo-Project/resolve/main/utils/fixseed.py
- Command line
-
hf download hf://spaces/Hemanth0004/Momask-Demo-Project/utils/fixseed.py
-
curl -L -o fixseed.py https://huggingface.co/spaces/Hemanth0004/Momask-Demo-Project/resolve/main/utils/fixseed.py
351 Bytes
| import numpy as np | |
| import torch | |
| import random | |
| def fixseed(seed): | |
| torch.backends.cudnn.benchmark = False | |
| random.seed(seed) | |
| np.random.seed(seed) | |
| torch.manual_seed(seed) | |
| # SEED = 10 | |
| # EVALSEED = 0 | |
| # # Provoc warning: not fully functionnal yet | |
| # # torch.set_deterministic(True) | |
| # torch.backends.cudnn.benchmark = False | |
| # fixseed(SEED) | |