MCPcopy Create free account
hub / github.com/THUDM/LongWriter / seed_everything

Function seed_everything

evaluation/pred.py:53–60  ·  view source on GitHub ↗
(seed)

Source from the content-addressed store, hash-verified

51 print(response)
52
53def seed_everything(seed):
54 torch.manual_seed(seed)
55 torch.cuda.manual_seed(seed)
56 np.random.seed(seed)
57 random.seed(seed)
58 torch.backends.cudnn.benchmark = False
59 torch.backends.cudnn.deterministic = True
60 torch.cuda.manual_seed_all(seed)
61
62if __name__ == '__main__':
63 seed_everything(42)

Callers 1

pred.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected