(path: Path)
| 20 | |
| 21 | |
| 22 | def load_split(path: Path): |
| 23 | rows = [] |
| 24 | with open(path) as f: |
| 25 | for line in f: |
| 26 | if line.strip(): |
| 27 | rows.append(json.loads(line)) |
| 28 | |
| 29 | texts, labels, benchmarks = [], [], [] |
| 30 | for row in rows: |
| 31 | for m in reversed(row.get("messages", [])): |
| 32 | if m.get("role") == "user": |
| 33 | text = _normalize_content(m.get("content", "")) |
| 34 | if text.strip(): |
| 35 | texts.append(text) |
| 36 | labels.append(row["target_tier_id"]) |
| 37 | benchmarks.append(row.get("benchmark", "?")) |
| 38 | break |
| 39 | return texts, labels, benchmarks |
| 40 | |
| 41 | |
| 42 | def main(): |
no test coverage detected