sohamc10's picture
gradio app
9b0d6c2
raw
history blame contribute delete
251 Bytes
import torch
import numpy as np
import random
def worker_init_fn(x):
seed = (torch.initial_seed() + x * 1000) % 2 ** 31 # problem with nearly seeded randoms
np.random.seed(seed)
random.seed(seed)
torch.manual_seed(seed)
return