(seed)
| 66 | print(e) |
| 67 | |
| 68 | def seed_everything(seed): |
| 69 | torch.manual_seed(seed) |
| 70 | torch.cuda.manual_seed(seed) |
| 71 | np.random.seed(seed) |
| 72 | random.seed(seed) |
| 73 | torch.backends.cudnn.benchmark = False |
| 74 | torch.backends.cudnn.deterministic = True |
| 75 | torch.cuda.manual_seed_all(seed) |
| 76 | |
| 77 | if __name__ == '__main__': |
| 78 | # input format: {"prompt": "xxx", ...} |