mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-30 19:36:24 +02:00
pre-commit format
This commit is contained in:
parent
0eec61188c
commit
7eb379bf9f
4 changed files with 45 additions and 46 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import re
|
||||
import re
|
||||
|
||||
|
||||
def extract_diff(response):
|
||||
|
|
|
|||
|
|
@ -8,11 +8,9 @@ original_argv = sys.argv.copy()
|
|||
|
||||
try:
|
||||
# 设置你想要传递给脚本的命令行参数
|
||||
sys.argv = ['run_api.py', '--dataset_name_or_path', 'princeton-nlp/SWE-bench_oracle', '--output_dir',
|
||||
'./outputs']
|
||||
sys.argv = ["run_api.py", "--dataset_name_or_path", "princeton-nlp/SWE-bench_oracle", "--output_dir", "./outputs"]
|
||||
# 执行脚本
|
||||
runpy.run_path(path_name='run_api.py', run_name='__main__')
|
||||
runpy.run_path(path_name="run_api.py", run_name="__main__")
|
||||
finally:
|
||||
# 恢复原始的sys.argv以避免对后续代码的潜在影响
|
||||
sys.argv = original_argv
|
||||
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ from make_datasets.utils import extract_diff
|
|||
from tenacity import retry, stop_after_attempt, wait_random_exponential
|
||||
from tqdm.auto import tqdm
|
||||
|
||||
from data.inference.const import SCIKIT_LEARN_IDS
|
||||
from metagpt.config2 import config
|
||||
from metagpt.logs import logger
|
||||
from metagpt.roles.di.data_interpreter import DataInterpreter
|
||||
from metagpt.utils import count_string_tokens
|
||||
from metagpt.utils.recovery_util import save_history
|
||||
from data.inference.const import SCIKIT_LEARN_IDS
|
||||
|
||||
# Replace with your own
|
||||
MAX_TOKEN = 128000
|
||||
|
|
@ -71,7 +71,7 @@ async def openai_inference(
|
|||
for datum in tqdm(test_dataset, desc=f"Inference for {model_name_or_path}"):
|
||||
di = DataInterpreter(use_reflection=use_reflection)
|
||||
instance_id = datum["instance_id"]
|
||||
|
||||
|
||||
if instance_id in existing_ids:
|
||||
continue
|
||||
output_dict = {"instance_id": instance_id}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue