Skip to content

Commit

Permalink
update code, change data path
Browse files Browse the repository at this point in the history
  • Loading branch information
stellaHSR committed Mar 26, 2024
1 parent f26a5cd commit 91db2ef
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,4 @@ cov.xml
*-structure.json
*.dot
.python-version
/data/inference
2 changes: 1 addition & 1 deletion data/load_dataset.py → swe_bench/data/load_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
from datasets import load_dataset, load_from_disk

from data.inference.const import SCIKIT_LEARN_IDS
from swe_bench.inference.const import SCIKIT_LEARN_IDS


def load_oracle_dataset(dataset_name_or_path: str = "", split: str = "test", existing_ids: list = []):
Expand Down
2 changes: 1 addition & 1 deletion data/inference/const.py → swe_bench/inference/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

SUBSET_DATASET = METAGPT_ROOT / "sub_swebench_dataset" / "sub_swebench.csv"
SUBSET_DATASET_SKLERARN = METAGPT_ROOT / "sub_swebench_dataset" / "scikit-learn-68.csv"
TESTBED = DATA_PATH / "repos"
TESTBED = METAGPT_ROOT / "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.
Expand Down
5 changes: 3 additions & 2 deletions swe_bench/inference/run_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
from pathlib import Path

import fire
from data.load_dataset import load_oracle_dataset

from tqdm.auto import tqdm

from metagpt.config2 import config
from metagpt.logs import logger
from metagpt.utils import count_string_tokens
from swe_bench.inference.run_agent import run_instance
from swe_bench.utils.utils import check_existing_ids, extract_diff
from swe_bench.data.load_dataset import load_oracle_dataset

# Replace with your own
MAX_TOKEN = 128000
Expand Down Expand Up @@ -56,7 +57,7 @@ async def openai_inference(
logger.info(f"{repo_prefix}_{version}")
data.append(f"{repo_prefix}_{version}")

response = await run_instance(instance=datum)
response = await run_instance(instance=datum, use_reflection=use_reflection)
if response is None:
continue
logger.info(f"Final response: {response}")
Expand Down
2 changes: 1 addition & 1 deletion swe_bench/make_datasets/make_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

from tqdm.auto import tqdm

from data.inference.const import TESTBED
from metagpt.logs import logger
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
from swe_bench.inference.const import TESTBED


def reset_task_env(instance: dict = {}):
Expand Down

0 comments on commit 91db2ef

Please sign in to comment.