update submit_eval_jobs

This commit is contained in:
ZhihongShao 2024-02-09 15:23:28 +08:00
parent 83d3c4cc6a
commit db877abb91
4 changed files with 32 additions and 15 deletions

View File

@ -1,5 +1,10 @@
import argparse import argparse
import os import os
import sys
import_path = os.path.abspath(__file__)
for _ in range(2):
import_path = os.path.dirname(import_path)
sys.path.append(import_path)
from tqdm import tqdm from tqdm import tqdm
import json import json

View File

@ -1,5 +1,11 @@
import argparse import argparse
import os import os
import sys
import_path = os.path.abspath(__file__)
for _ in range(2):
import_path = os.path.dirname(import_path)
sys.path.append(import_path)
import json import json
from copy import deepcopy from copy import deepcopy
from functools import partial from functools import partial

View File

@ -1,5 +1,11 @@
import argparse import argparse
import os import os
import sys
import_path = os.path.abspath(__file__)
for _ in range(2):
import_path = os.path.dirname(import_path)
sys.path.append(import_path)
from tqdm import tqdm from tqdm import tqdm
import regex import regex
import json import json

View File

@ -46,21 +46,21 @@ def main():
args = parser.parse_args() args = parser.parse_args()
conf = base_conf # TODO: your conf here conf = base_conf # TODO: your conf here
for rank in range(args.n_gpus): cmd = "python run_subset_parallel.py"
cmd = "python run_subset_parallel.py" for key, val in conf.items():
for key, val in conf.items(): if key == 'expname':
if key == 'expname': continue
continue if isinstance(val, str):
if isinstance(val, str): cmd += f" --{key} {val}"
cmd += f" --{key} {val}" elif val:
elif val: cmd += f" --{key}"
cmd += f" --{key}" cmd += f" --test-conf {conf['test-conf']}"
cmd += f" --test-conf {conf['test-conf']}" cmd += f" --n-repeats {args.n_repeats}"
cmd += f" --n-repeats {args.n_repeats}" cmd += f" --temperature {args.temperature}"
cmd += f" --temperature {args.temperature}" cmd += f" --ngpus {args.n_gpus}"
cmd += f" --rank {rank} &" cmd += f" --rank {0} &"
print(cmd, flush=True) print(cmd, flush=True)
os.system(cmd) os.system(cmd)
if __name__ == '__main__': if __name__ == '__main__':
main() main()