Skip to content

Commit 53f577a

Browse files
fix(utils): shift seeding per process (#141)
1 parent dc0e060 commit 53f577a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

trlx/utils/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def set_seed(seed: int):
2020
"""
2121
Sets seeds across package dependencies for reproducibility.
2222
"""
23+
seed += int(os.environ.get("LOCAL_RANK", 0))
2324
random.seed(seed)
2425
np.random.seed(seed)
2526
torch.manual_seed(seed)

0 commit comments

Comments
 (0)