bbkdevops's picture
download
raw
1.91 kB
#!/usr/bin/env python
from __future__ import annotations
import json
from collections import Counter
from pathlib import Path
ROOT = Path(r"D:\ad\tinymind\data\distill")
JSONL = ROOT / "jsonl" / "apexdistill_gold.jsonl"
OUT = ROOT / "manifests" / "distill_dimension_audit.json"
def main() -> int:
counts = {
"records": 0,
"domains": Counter(),
"axes": Counter(),
"lenses": Counter(),
"pressures": Counter(),
"rubric_fields": Counter(),
"avg_quality": 0.0,
}
total_quality = 0.0
with JSONL.open("r", encoding="utf-8") as f:
for line in f:
if not line.strip():
continue
item = json.loads(line)
counts["records"] += 1
counts["domains"][item["domain"]] += 1
inputs = item.get("inputs", {})
counts["axes"][inputs.get("distill_axis", "base")] += 1
counts["lenses"][inputs.get("lens", "base")] += 1
counts["pressures"][inputs.get("pressure", "base")] += 1
rubric = item.get("quality", {}).get("rubric", {})
for key in rubric:
counts["rubric_fields"][key] += 1
total_quality += item.get("quality", {}).get("score", 0.0)
result = {
"records": counts["records"],
"domains": dict(counts["domains"]),
"axes": dict(counts["axes"]),
"lenses": dict(counts["lenses"]),
"pressures": dict(counts["pressures"]),
"rubric_fields": dict(counts["rubric_fields"]),
"avg_quality": round(total_quality / max(counts["records"], 1), 4),
"jsonl_mb": round(JSONL.stat().st_size / 1024 / 1024, 3),
}
OUT.write_text(json.dumps(result, indent=2, ensure_ascii=False), encoding="utf-8")
print(json.dumps(result, indent=2, ensure_ascii=False))
return 0
if __name__ == "__main__":
raise SystemExit(main())

Xet Storage Details

Size:
1.91 kB
·
Xet hash:
c99b3a398c3178c4f5bf50a4f4b0a41c9cc8261d498ade4f2f3d1cafc6aa78f7

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.