SWE-bench
minisweagent.run.extra.swebench
Run mini-SWE-agent on SWEBench instances.
[not dim] More information about the usage: [bold green]https://mini-swe-agent.com/latest/usage/swebench/[/bold green][/not dim]
app
module-attribute
app = Typer(rich_markup_mode='rich', add_completion=False)
DATASET_MAPPING
module-attribute
DATASET_MAPPING = {
"full": "princeton-nlp/SWE-Bench",
"verified": "princeton-nlp/SWE-Bench_Verified",
"lite": "princeton-nlp/SWE-Bench_Lite",
"multimodal": "princeton-nlp/SWE-Bench_Multimodal",
"multilingual": "swe-bench/SWE-Bench_Multilingual",
"smith": "SWE-bench/SWE-smith",
"_test": "klieret/swe-bench-dummy-test-dataset",
}
ProgressTrackingAgent
ProgressTrackingAgent(
*args,
progress_manager: RunBatchProgressManager,
instance_id: str = "",
**kwargs,
)
Bases: DefaultAgent
Simple wrapper around DefaultAgent that provides progress updates.
Source code in src/minisweagent/run/extra/swebench.py
50 51 52 53 |
|
progress_manager
instance-attribute
progress_manager: RunBatchProgressManager = progress_manager
instance_id
instance-attribute
instance_id = instance_id
step
step() -> dict
Override step to provide progress updates.
Source code in src/minisweagent/run/extra/swebench.py
55 56 57 58 59 60 |
|
get_swebench_docker_image_name
get_swebench_docker_image_name(instance: dict) -> str
Get the image name for a SWEBench instance.
Source code in src/minisweagent/run/extra/swebench.py
63 64 65 66 67 68 69 70 71 |
|
update_preds_file
update_preds_file(
output_path: Path,
instance_id: str,
model_name: str,
result: str,
)
Update the output JSON file with results from a single instance.
Source code in src/minisweagent/run/extra/swebench.py
74 75 76 77 78 79 80 81 82 83 84 85 |
|
remove_from_preds_file
remove_from_preds_file(output_path: Path, instance_id: str)
Remove an instance from the predictions file.
Source code in src/minisweagent/run/extra/swebench.py
88 89 90 91 92 93 94 95 96 |
|
process_instance
process_instance(
instance: dict,
output_dir: Path,
model_name: str | None,
config_path: str | Path,
progress_manager: RunBatchProgressManager,
) -> None
Process a single SWEBench instance.
Source code in src/minisweagent/run/extra/swebench.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
filter_instances
filter_instances(
instances: list[dict],
*,
filter_spec: str,
slice_spec: str = "",
shuffle: bool = False,
) -> list[dict]
Filter and slice a list of SWEBench instances.
Source code in src/minisweagent/run/extra/swebench.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
main
main(
subset: str = Option(
"lite",
"--subset",
help="SWEBench subset to use or path to a dataset",
),
split: str = Option(
"dev", "--split", help="Dataset split"
),
slice_spec: str = Option(
"",
"--slice",
help="Slice specification (e.g., '0:5' for first 5 instances)",
),
filter_spec: str = Option(
"", "--filter", help="Filter instance IDs by regex"
),
shuffle: bool = Option(
False, "--shuffle", help="Shuffle instances"
),
output: str = Option(
"", "-o", "--output", help="Output directory"
),
workers: int = Option(
1,
"-w",
"--workers",
help="Number of worker threads for parallel processing",
),
model: str | None = Option(
None, "-m", "--model", help="Model to use"
),
redo_existing: bool = Option(
False,
"--redo-existing",
help="Redo existing instances",
),
config: Path = Option(
builtin_config_dir / "extra" / "swebench.yaml",
"-c",
"--config",
help="Path to a config file",
),
) -> None
Run mini-SWE-agent on SWEBench instances
Source code in src/minisweagent/run/extra/swebench.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
|