Skip to content

Commit 78b82da

Browse files
authored
Update eval.py
1 parent 0a7838f commit 78b82da

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

flowdock/eval.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22

33
import hydra
4+
import lightning as L
45
import lovely_tensors as lt
56
import rootutils
67
import torch
@@ -56,6 +57,10 @@ def evaluate(cfg: DictConfig) -> Tuple[Dict[str, Any], Dict[str, Any]]:
5657
assert cfg.ckpt_path, "Please provide a checkpoint path to evaluate!"
5758
assert os.path.exists(cfg.ckpt_path), f"Checkpoint path {cfg.ckpt_path} does not exist!"
5859

60+
# set seed for random number generators in pytorch, numpy and python.random
61+
if cfg.get("seed"):
62+
L.seed_everything(cfg.seed, workers=True)
63+
5964
log.info(
6065
f"Setting `float32_matmul_precision` to {cfg.model.cfg.task.float32_matmul_precision}."
6166
)

0 commit comments

Comments
 (0)