Spaces:
Sleeping
Sleeping
timchen0618 commited on
Commit ·
58fe58d
1
Parent(s): 74c4b8c
Fix selected_indices parsing for new datasets (stored as JSON string)
Browse files
backend/api/selected_tools.py
CHANGED
|
@@ -88,10 +88,16 @@ def _load(variant: str) -> list:
|
|
| 88 |
except Exception:
|
| 89 |
pass
|
| 90 |
total_tool_calls = sum(tool_counts.values()) if tool_counts else 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
rows.append({
|
| 92 |
"query_id": str(row["query_id"]),
|
| 93 |
"rationale": row["rationale"],
|
| 94 |
-
"selected_indices":
|
| 95 |
"k_requested": int(row["k_requested"]),
|
| 96 |
"k_effective": int(row["k_effective"]),
|
| 97 |
"excerpt": row["excerpt"],
|
|
|
|
| 88 |
except Exception:
|
| 89 |
pass
|
| 90 |
total_tool_calls = sum(tool_counts.values()) if tool_counts else 0
|
| 91 |
+
sel_idx = row["selected_indices"]
|
| 92 |
+
if isinstance(sel_idx, str):
|
| 93 |
+
try:
|
| 94 |
+
sel_idx = json.loads(sel_idx)
|
| 95 |
+
except Exception:
|
| 96 |
+
sel_idx = []
|
| 97 |
rows.append({
|
| 98 |
"query_id": str(row["query_id"]),
|
| 99 |
"rationale": row["rationale"],
|
| 100 |
+
"selected_indices": sel_idx,
|
| 101 |
"k_requested": int(row["k_requested"]),
|
| 102 |
"k_effective": int(row["k_effective"]),
|
| 103 |
"excerpt": row["excerpt"],
|