Spaces:
Running
Running
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}") | |