Skip to content

Commit

Permalink
set random.seed if configured
Browse files Browse the repository at this point in the history
  • Loading branch information
leondz committed Oct 18, 2024
1 parent dc0bea8 commit 9fdd706
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions garak/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,15 @@ def main(arguments=None) -> None:
if "buffs" in args:
_config.plugins.buff_spec = args.buffs

# base config complete

if hasattr(_config.run, "seed") and isinstance(_config.run.seed, int):
import random

random.seed(
_config.run.seed
) # setting seed persists across re-imports of random

# startup
import sys
import json
Expand Down

0 comments on commit 9fdd706

Please sign in to comment.