Commit ·
e080b1d
1
Parent(s): f0b5b33
Fix FAIL_TO_PASS/PASS_TO_PASS parsing for SWE-bench Multilingual
Browse filesSWE-bench Multilingual stores these fields as native lists, while the
original SWE-bench stores them as JSON strings. Handle both types so
the shared SWEBenchLiteAdapter.get_problem_detail() works for all
SWE-bench variants.
- adapters/code_editing.py +4 -2
adapters/code_editing.py
CHANGED
|
@@ -57,8 +57,10 @@ class SWEBenchLiteAdapter(DatasetAdapter):
|
|
| 57 |
def get_problem_detail(self, idx: int) -> dict[str, Any]:
|
| 58 |
row = self._ds[idx]
|
| 59 |
patch = row["patch"]
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
| 62 |
instance_id = row["instance_id"]
|
| 63 |
repo = row["repo"]
|
| 64 |
base_commit = row.get("base_commit", "")
|
|
|
|
| 57 |
def get_problem_detail(self, idx: int) -> dict[str, Any]:
|
| 58 |
row = self._ds[idx]
|
| 59 |
patch = row["patch"]
|
| 60 |
+
raw_f2p = row["FAIL_TO_PASS"]
|
| 61 |
+
fail_to_pass = raw_f2p if isinstance(raw_f2p, list) else (json.loads(raw_f2p) if raw_f2p else [])
|
| 62 |
+
raw_p2p = row["PASS_TO_PASS"]
|
| 63 |
+
pass_to_pass = raw_p2p if isinstance(raw_p2p, list) else (json.loads(raw_p2p) if raw_p2p else [])
|
| 64 |
instance_id = row["instance_id"]
|
| 65 |
repo = row["repo"]
|
| 66 |
base_commit = row.get("base_commit", "")
|