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

Function seed_everything

agentwrite/write.py:90–97  ·  view source on GitHub ↗
(seed)

Source from the content-addressed store, hash-verified

88 print(e)
89
90def seed_everything(seed):
91 torch.manual_seed(seed)
92 torch.cuda.manual_seed(seed)
93 np.random.seed(seed)
94 random.seed(seed)
95 torch.backends.cudnn.benchmark = False
96 torch.backends.cudnn.deterministic = True
97 torch.cuda.manual_seed_all(seed)
98
99if __name__ == '__main__':
100 # input format: {"prompt": "xxx", "plan": "xxx", ...}

Callers 1

write.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected