deep-thinking / common.py
jx-yang's picture
<ADD> +app
9d21d47
raw
history blame
374 Bytes
import os
import random
import numpy as np
import torch
from tasks import task_mapper
def setup_plain_seed(SEED):
os.environ["PYTHONHASHSEED"] = str(SEED)
random.seed(SEED)
np.random.seed(SEED)
def setup_cpu(seed):
os.environ["TOKENIZERS_PARALLELISM"] = "false"
setup_plain_seed(seed)
torch.manual_seed(seed)
torch.random.manual_seed(seed)