MCPcopy Index your code
hub / github.com/CommonstackAI/UncommonRoute / load_split

Function load_split

scripts/experiment_setfit.py:22–39  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

20
21
22def 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
42def main():

Callers 1

mainFunction · 0.70

Calls 4

_normalize_contentFunction · 0.90
openFunction · 0.85
appendMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected