update path

This commit is contained in:
stellahsr 2024-03-26 15:28:37 +08:00
parent e88b0fdf16
commit 50f4953ea7
17 changed files with 17 additions and 13 deletions

View file

@ -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 = []):

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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 = {}):

View file

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# @Author : stellahong (stellahong@fuzhi.ai)
# @Desc :

View file

@ -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.