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

Function seed_everything

agentwrite/plan.py:68–75  ·  view source on GitHub ↗
(seed)

Source from the content-addressed store, hash-verified

66 print(e)
67
68def 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
77if __name__ == '__main__':
78 # input format: {"prompt": "xxx", ...}

Callers 1

plan.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected