-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_train.py
31 lines (26 loc) · 1.31 KB
/
run_train.py
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
from multiprocessing import Pool
import os
from random import randint
from time import sleep
def run(cmd, use_sleep=True):
print(cmd)
if use_sleep:
sleep(randint(0, 200))
os.system(cmd)
if __name__ == "__main__":
all_cmd = [
"python main.py --mode norm_only --bert-config configs/config.velectra.json",
"python main.py --mode punc_only --bert-config configs/config.velectra.json",
"python main.py --mode norm_to_punc --bert-config configs/config.velectra.json",
"python main.py --mode punc_to_norm --bert-config configs/config.velectra.json",
"python main.py --mode norm_only --bert-config configs/config.vibert.json",
"python main.py --mode punc_only --bert-config configs/config.vibert.json",
"python main.py --mode norm_to_punc --bert-config configs/config.vibert.json",
"python main.py --mode punc_to_norm --bert-config configs/config.vibert.json",
"python main.py --mode norm_only --bert-config configs/config.mbert.json",
"python main.py --mode punc_only --bert-config configs/config.mbert.json",
"python main.py --mode norm_to_punc --bert-config configs/config.mbert.json",
"python main.py --mode punc_to_norm --bert-config configs/config.mbert.json",
]
with Pool(3) as p:
p.map(run, all_cmd)