File size: 378 Bytes
b805057
89860e6
 
 
 
 
b805057
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import torch
import os
import dotenv

dotenv.load_dotenv()

TEST_MODE = (os.getenv('TEST_MODE', 'False') == "True")

if torch.cuda.is_available():
    device = torch.device("cuda:0")
    dtype = torch.float16
else:
    device = torch.device("cpu")
    dtype = torch.float32

from datetime import datetime

def log(data: dict):
    print(f"{datetime.now().isoformat()}: {data}")