MCPcopy Create free account
hub / github.com/FSoft-AI4Code/HyperAgent / __init__

Method __init__

src/hyperagent/tasks/github_issue_resolve.py:8–27  ·  view source on GitHub ↗
(self, logdir, split, _type="patch", **kwargs)

Source from the content-addressed store, hash-verified

6
7class SWEBench(BaseTask):
8 def __init__(self, logdir, split, _type="patch", **kwargs):
9 self.max_repetitions = kwargs.get("max_repetitions", 3)
10 self.task_template = """You need to identify the cause of the following github issue, collect the relevant information, and provide a solution.
11 Github Issue: ```{issue}```"""
12
13 self.logdir = logdir
14 self.dataset = load_dataset("princeton-nlp/SWE-bench_Verified")[split]
15
16 client = docker.from_env()
17
18 successful, failed = build_instance_images(
19 client=client,
20 dataset=self.dataset,
21 force_rebuild=False,
22 max_workers=12,
23 )
24
25 self.images = {specs.instance_id: specs.instance_image_key for specs in successful}
26 self.dataset = self.dataset.filter(lambda x: x["instance_id"] in [specs.instance_id for specs in successful])
27 self.setup_scripts = ["\n".join(["#!/bin/bash", "set -euxo pipefail"] + specs.env_script_list) + "\n" for specs in successful]
28
29
30 def construct_prompt(self, idx):

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected