From db877abb91b15ac0a59c2bb81c9b9460069dd4a8 Mon Sep 17 00:00:00 2001 From: ZhihongShao Date: Fri, 9 Feb 2024 15:23:28 +0800 Subject: [PATCH] update submit_eval_jobs --- evaluation/infer/run_cot_eval.py | 5 ++++ evaluation/infer/run_pal_eval.py | 6 ++++ evaluation/infer/run_tool_integrated_eval.py | 6 ++++ evaluation/submit_eval_jobs.py | 30 ++++++++++---------- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/evaluation/infer/run_cot_eval.py b/evaluation/infer/run_cot_eval.py index 1bd056c..8dddc5c 100755 --- a/evaluation/infer/run_cot_eval.py +++ b/evaluation/infer/run_cot_eval.py @@ -1,5 +1,10 @@ import argparse 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 import json diff --git a/evaluation/infer/run_pal_eval.py b/evaluation/infer/run_pal_eval.py index 8c547bf..8bf5664 100644 --- a/evaluation/infer/run_pal_eval.py +++ b/evaluation/infer/run_pal_eval.py @@ -1,5 +1,11 @@ import argparse 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 from copy import deepcopy from functools import partial diff --git a/evaluation/infer/run_tool_integrated_eval.py b/evaluation/infer/run_tool_integrated_eval.py index dc8b0b6..00d1dad 100755 --- a/evaluation/infer/run_tool_integrated_eval.py +++ b/evaluation/infer/run_tool_integrated_eval.py @@ -1,5 +1,11 @@ import argparse 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 import regex import json diff --git a/evaluation/submit_eval_jobs.py b/evaluation/submit_eval_jobs.py index 2093a2f..f189d0d 100644 --- a/evaluation/submit_eval_jobs.py +++ b/evaluation/submit_eval_jobs.py @@ -46,21 +46,21 @@ def main(): args = parser.parse_args() conf = base_conf # TODO: your conf here - for rank in range(args.n_gpus): - cmd = "python run_subset_parallel.py" - for key, val in conf.items(): - if key == 'expname': - continue - if isinstance(val, str): - cmd += f" --{key} {val}" - elif val: - cmd += f" --{key}" - cmd += f" --test-conf {conf['test-conf']}" - cmd += f" --n-repeats {args.n_repeats}" - cmd += f" --temperature {args.temperature}" - cmd += f" --rank {rank} &" - print(cmd, flush=True) - os.system(cmd) + cmd = "python run_subset_parallel.py" + for key, val in conf.items(): + if key == 'expname': + continue + if isinstance(val, str): + cmd += f" --{key} {val}" + elif val: + cmd += f" --{key}" + cmd += f" --test-conf {conf['test-conf']}" + cmd += f" --n-repeats {args.n_repeats}" + cmd += f" --temperature {args.temperature}" + cmd += f" --ngpus {args.n_gpus}" + cmd += f" --rank {0} &" + print(cmd, flush=True) + os.system(cmd) if __name__ == '__main__': main()