Skip to content

Commit a180b29

Browse files
authored
Update sample.py
1 parent cc7320e commit a180b29

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

flowdock/sample.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 pandas as pd
67
import rootutils
@@ -152,6 +153,10 @@ def sample(cfg: DictConfig) -> Tuple[Dict[str, Any], Dict[str, Any]]:
152153
cfg.csv_path is not None and os.path.exists(cfg.csv_path)
153154
), "Please provide either an input receptor and ligand or a CSV file with receptor and ligand sequences/filepaths."
154155

156+
# set seed for random number generators in pytorch, numpy and python.random
157+
if cfg.get("seed"):
158+
L.seed_everything(cfg.seed, workers=True)
159+
155160
log.info(
156161
f"Setting `float32_matmul_precision` to {cfg.model.cfg.task.float32_matmul_precision}."
157162
)

0 commit comments

Comments
 (0)