File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -95,13 +95,15 @@ def enforce_tags(tags: Optional[List[str]]) -> List[str]:
9595 return tags
9696
9797
98- def seed_index_everything (train_cfg : DictConfig , sampling_seed : int = 42 ) -> None :
98+ def seed_index_everything (train_cfg : DictConfig , sampling_seed : int = 42 ) -> Optional [ int ] :
9999 if "seed_index" in train_cfg and train_cfg .seed_index is not None :
100100 seed_index = train_cfg .seed_index
101101 np .random .seed (sampling_seed )
102102 seeds = np .random .randint (np .iinfo (np .int32 ).max , size = max (42 , seed_index + 1 ))
103103 seed = seeds [seed_index ]
104104 seed_everything (seed )
105105 pylogger .info (f"Setting seed { seed } from seeds[{ seed_index } ]" )
106+ return seed
106107 else :
107108 pylogger .warning ("The seed has not been set! The reproducibility is not guaranteed." )
109+ return None
You can’t perform that action at this time.
0 commit comments