mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-29 10:56:22 +02:00
update path
This commit is contained in:
parent
e88b0fdf16
commit
50f4953ea7
17 changed files with 17 additions and 13 deletions
|
|
@ -6,7 +6,7 @@ from pathlib import Path
|
|||
import numpy as np
|
||||
from datasets import load_dataset, load_from_disk
|
||||
|
||||
from swe_bench.inference.const import SCIKIT_LEARN_IDS
|
||||
from benchmark.swe_bench.inference.const import SCIKIT_LEARN_IDS
|
||||
|
||||
|
||||
def load_oracle_dataset(dataset_name_or_path: str = "", split: str = "test", existing_ids: list = []):
|
||||
|
|
@ -7,7 +7,7 @@ from metagpt.const import METAGPT_ROOT
|
|||
|
||||
SUBSET_DATASET = METAGPT_ROOT / "sub_swebench_dataset" / "sub_swebench.csv"
|
||||
SUBSET_DATASET_SKLERARN = METAGPT_ROOT / "sub_swebench_dataset" / "scikit-learn-68.csv"
|
||||
TESTBED = METAGPT_ROOT / "swe-bench" / "data" / "repos"
|
||||
TESTBED = METAGPT_ROOT / "benchmark" / "swe-bench" / "data" / "repos"
|
||||
|
||||
# SCIKIT_LEARN_IDS: A list of instance identifiers from 'sub_swebench.csv' within SUBSET_DATASET.
|
||||
# This collection represents a subset specifically related to scikit-learn content.
|
||||
|
|
@ -5,12 +5,12 @@ import re
|
|||
|
||||
from tenacity import retry, stop_after_attempt, wait_random_exponential
|
||||
|
||||
from benchmark.swe_bench.gitagent import GitAgent
|
||||
from benchmark.swe_bench.make_datasets.make_dataset import reset_task_env
|
||||
from benchmark.swe_bench.utils.utils import extract_scripts_from_codetext
|
||||
from metagpt.logs import logger
|
||||
from metagpt.utils.exceptions import handle_exception
|
||||
from metagpt.utils.recovery_util import save_history
|
||||
from swe_bench.gitagent import GitAgent
|
||||
from swe_bench.make_datasets.make_dataset import reset_task_env
|
||||
from swe_bench.utils.utils import extract_scripts_from_codetext
|
||||
|
||||
PATCH_FORMAT = """
|
||||
```diff
|
||||
|
|
@ -4,12 +4,12 @@ from pathlib import Path
|
|||
import fire
|
||||
from tqdm.auto import tqdm
|
||||
|
||||
from benchmark.swe_bench.data.load_dataset import load_oracle_dataset
|
||||
from benchmark.swe_bench.inference.run_agent import run_instance
|
||||
from benchmark.swe_bench.utils.utils import check_existing_ids, extract_diff
|
||||
from metagpt.config2 import config
|
||||
from metagpt.logs import logger
|
||||
from metagpt.utils import count_string_tokens
|
||||
from swe_bench.data.load_dataset import load_oracle_dataset
|
||||
from swe_bench.inference.run_agent import run_instance
|
||||
from swe_bench.utils.utils import check_existing_ids, extract_diff
|
||||
|
||||
# Replace with your own
|
||||
MAX_TOKEN = 128000
|
||||
|
|
@ -6,11 +6,11 @@ from pathlib import Path
|
|||
|
||||
from tqdm.auto import tqdm
|
||||
|
||||
from benchmark.swe_bench.inference.const import TESTBED
|
||||
from benchmark.swe_bench.make_datasets.make_instance import prompt_style_2_edits_only
|
||||
from benchmark.swe_bench.utils.parse_diff import filter_changed_line
|
||||
from benchmark.swe_bench.utils.repo_utils import EnvManager
|
||||
from metagpt.logs import logger
|
||||
from swe_bench.inference.const import TESTBED
|
||||
from swe_bench.make_datasets.make_instance import prompt_style_2_edits_only
|
||||
from swe_bench.utils.parse_diff import filter_changed_line
|
||||
from swe_bench.utils.repo_utils import EnvManager
|
||||
|
||||
|
||||
def reset_task_env(instance: dict = {}):
|
||||
3
benchmark/swe_bench/utils/__init__.py
Normal file
3
benchmark/swe_bench/utils/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Author : stellahong (stellahong@fuzhi.ai)
|
||||
# @Desc :
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
import re
|
||||
from typing import Dict, List
|
||||
|
||||
from metagpt.logs import logger
|
||||
from swe_bench.utils.enums import FileChangeMode, LineChangeType
|
||||
|
||||
from metagpt.logs import logger
|
||||
|
||||
|
||||
def extract_changes_from_patch(diff: str) -> List[Dict[str, any]]:
|
||||
"""Parses the patch text through the standard syntax of git diff, outputs the information of added and deleted lines.
|
||||
Loading…
Add table
Add a link
Reference in a new issue