Spaces:
Runtime error
Runtime error
Download bert_pytorch/dataset/utils.py from MukeshKapoor25/logbert_processor: direct link, hf CLI and curl.
- Browser
- Download file 538 Bytes
-
https://huggingface.co/spaces/MukeshKapoor25/logbert_processor/resolve/main/bert_pytorch/dataset/utils.py
- Command line
-
hf download hf://spaces/MukeshKapoor25/logbert_processor/bert_pytorch/dataset/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/MukeshKapoor25/logbert_processor/resolve/main/bert_pytorch/dataset/utils.py
538 Bytes
| import random | |
| import os | |
| import numpy as np | |
| import torch | |
| def save_parameters(options, filename): | |
| with open(filename, "w+") as f: | |
| for key in options.keys(): | |
| f.write("{}: {}\n".format(key, options[key])) | |
| # https://gist.github.com/KirillVladimirov/005ec7f762293d2321385580d3dbe335 | |
| def seed_everything(seed=1234): | |
| 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 |