"""Static showcase page for the cleaner (free-tier Space). Renders the REAL issue report from running modelbrew_cleaner on the bundled dirty sample — no fabricated output. Run inside the package venv: PYTHONPATH= ../modelbrew-cleaner/.venv/bin/python build_static.py """ import html from pathlib import Path from modelbrew_cleaner import Severity, clean_file, issue_summary HERE = Path(__file__).parent rows = clean_file(str(HERE / "sample.jsonl")) summary = issue_summary(rows) n_critical_rows = sum(1 for r in rows if any(i.severity == Severity.critical for i in r.issues)) SEV_ORDER = {"critical": 0, "warning": 1, "suggestion": 2} records = sorted( ((r.row_index, i) for r in rows for i in r.issues), key=lambda x: (SEV_ORDER[x[1].severity.value], x[0]), ) table_rows = "".join( f"{idx}{i.severity.value}" f"{html.escape(i.code)}{html.escape(i.message)}" f"{'✔' if i.auto_fixable else ''}" for idx, i in records ) page = f""" ModelBrew Dataset Cleaner

🧹 ModelBrew Dataset Cleaner

90+ quality checks for fine-tuning datasets: PII with real checksum validation, exact/near duplicates, prompt-injection & jailbreak patterns, label errors, truncated responses, and more. Free and open source.

Clean your dataset in the browser → GitHub

Or in your pipeline

pip install modelbrew-cleaner

from modelbrew_cleaner import clean_file, issue_summary, export_clean
rows = clean_file("train.jsonl")     # .jsonl, .json, or .csv
print(issue_summary(rows))           # {summary}
cleaned = export_clean(rows)         # critical rows dropped

Real output — the bundled dirty sample ({len(rows)} rows)

This report is generated by actually running the cleaner on sample.jsonl at build time — {summary['critical']} critical / {summary['warning']} warnings / {summary['suggestion']} suggestions; {n_critical_rows} rows dropped from the cleaned export.

{table_rows}
rowseveritycheckmessageauto-fix

Why we built it

We work on fine-tuning without catastrophic forgetting (patent-pending CRMA adapters). Measuring forgetting honestly forced us to fix our data first — in our measurements, dataset confounds alone accounted for a 96.9-percentage-point swing in measured forgetting. Read: Your forgetting benchmark is lying to you · Browse the forgetting leaderboard.

""" (HERE / "index.html").write_text(page) print(f"wrote index.html ({len(page)} bytes) — report rows: {len(records)}")