fix random seeds to actually randomize
Without this fix, manual seeds get locked in.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import random
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
@@ -97,10 +98,11 @@ def formatted_outputs(reply, model_name):
|
|||||||
|
|
||||||
|
|
||||||
def set_manual_seed(seed):
|
def set_manual_seed(seed):
|
||||||
if seed != -1:
|
if seed == -1:
|
||||||
torch.manual_seed(seed)
|
seed = random.randint(1, 2**31)
|
||||||
if torch.cuda.is_available():
|
torch.manual_seed(seed)
|
||||||
torch.cuda.manual_seed_all(seed)
|
if torch.cuda.is_available():
|
||||||
|
torch.cuda.manual_seed_all(seed)
|
||||||
|
|
||||||
|
|
||||||
def stop_everything_event():
|
def stop_everything_event():
|
||||||
|
|||||||
Reference in New Issue
Block a user