MCPcopy Create free account
hub / github.com/PKU-Alignment/align-anything / seed_everything

Function seed_everything

align_anything/utils/tools.py:378–384  ·  view source on GitHub ↗

Set global random seed for reproducibility.

(seed: int)

Source from the content-addressed store, hash-verified

376
377
378def seed_everything(seed: int) -> None:
379 """Set global random seed for reproducibility."""
380 seed = int(seed)
381 os.environ['PYTHONHASHSEED'] = str(seed)
382 random.seed(seed)
383 np.random.seed(seed)
384 manual_seed_all(seed)
385
386
387def split_prompt_response(

Callers 15

sft.pyFile · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90

Calls 1

manual_seed_allFunction · 0.90

Tested by

no test coverage detected