MCPcopy
hub / github.com/jingyaogong/minimind / setup_seed

Function setup_seed

trainer/trainer_utils.py:54–61  ·  view source on GitHub ↗
(seed: int)

Source from the content-addressed store, hash-verified

52
53
54def setup_seed(seed: int):
55 random.seed(seed)
56 np.random.seed(seed)
57 torch.manual_seed(seed)
58 torch.cuda.manual_seed(seed)
59 torch.cuda.manual_seed_all(seed)
60 torch.backends.cudnn.deterministic = True
61 torch.backends.cudnn.benchmark = False
62
63def lm_checkpoint(lm_config, weight='full_sft', model=None, optimizer=None, epoch=0, step=0, wandb=None, save_dir='../checkpoints', **kwargs):
64 os.makedirs(save_dir, exist_ok=True)

Callers 10

mainFunction · 0.90
mainFunction · 0.90
train_lora.pyFile · 0.90
train_ppo.pyFile · 0.90
train_agent.pyFile · 0.90
train_pretrain.pyFile · 0.90
train_full_sft.pyFile · 0.90
train_grpo.pyFile · 0.90
train_dpo.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected