-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
60 lines (40 loc) · 1.27 KB
/
Copy pathmain.py
File metadata and controls
60 lines (40 loc) · 1.27 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from Utilities import *
import argparse
import yaml
import os
from torch import stack, tensor, set_float32_matmul_precision, Generator, cat, float32, nonzero
set_float32_matmul_precision('high')
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
def load_config(file_path):
with open(file_path, 'r') as stream:
config = yaml.load(stream, Loader=Loader)
return config
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Parse YAML configuration file')
parser.add_argument('config_file', type=str, help='Path to the YAML configuration file')
args = parser.parse_args()
config = load_config(args.config_file)
what = config['what']
if what == 'qm_atomic' or what == 'qm_selection':
del[config['what']]
out = QM_atomic_pretraining(
**config
)
elif what == 'homo-lumo':
del[config['what']]
out = HLgap_pretraining(
**config
)
elif what == 'masking':
del[config['what']]
out = masking_pretraining(
**config
)
elif what == 'tdc':
del[config['what']]
out = TDC_downstream(
**config
)