feat: Corrections tab — SFT candidate import, review, and JSONL export #15

Merged
pyr0ball merged 99 commits from feat/sft-corrections into main 2026-04-08 22:19:01 -07:00
2 changed files with 11 additions and 1 deletions
Showing only changes of commit d1a36bfd63 - Show all commits

View file

@ -171,7 +171,14 @@ def discover_finetuned_models(models_dir: Path | None = None) -> list[dict]:
info_path = sub / "training_info.json" info_path = sub / "training_info.json"
if not info_path.exists(): if not info_path.exists():
continue continue
info = json.loads(info_path.read_text(encoding="utf-8")) try:
info = json.loads(info_path.read_text(encoding="utf-8"))
except Exception as exc:
print(f"[discover] WARN: skipping {info_path}: {exc}", flush=True)
continue
if "name" not in info:
print(f"[discover] WARN: skipping {info_path}: missing 'name' key", flush=True)
continue
info["model_dir"] = str(sub) info["model_dir"] = str(sub)
found.append(info) found.append(info)
return found return found

View file

@ -120,6 +120,9 @@ def test_discover_finetuned_models_finds_training_info_files(tmp_path):
names = {r["name"] for r in results} names = {r["name"] for r in results}
assert "avocet-deberta-small" in names assert "avocet-deberta-small" in names
assert "avocet-bge-m3" in names assert "avocet-bge-m3" in names
for r in results:
assert "model_dir" in r, "discover_finetuned_models must inject model_dir key"
assert r["model_dir"].endswith(r["name"])
def test_discover_finetuned_models_returns_empty_when_no_models_dir(): def test_discover_finetuned_models_returns_empty_when_no_models_dir():