-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
28 lines (20 loc) · 828 Bytes
/
Copy pathrun.py
File metadata and controls
28 lines (20 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
import os
import torch
from lightning.pytorch import seed_everything
from src.utils.runner_utils import start_of_a_run
from task_processor import task_processor
import warnings
warnings.filterwarnings("ignore")
if __name__ == "__main__":
config = start_of_a_run()
os.environ['TOKENIZERS_PARALLELISM'] = config['TOKENIZERS_PARALLELISM']
os.environ['CUDA_LAUNCH_BLOCKING'] = config['CUDA_LAUNCH_BLOCKING']
os.environ['TORCH_USE_CUDA_DS'] = config['TORCH_USE_CUDA_DS']
torch.set_float32_matmul_precision(config['float32_matmul_precision'])
torch.autograd.set_detect_anomaly(True)
# sets seeds for numpy, torch and python.random.
seed_everything(config['seed'], workers=True)
# For training the model
task_processor(config)
## Evaluate the model