Spaces:
Sleeping
Sleeping
Load the highest-step checkpoint, not the newest probe
Browse files
app.py
CHANGED
|
@@ -82,23 +82,24 @@ def list_candidates():
|
|
| 82 |
|
| 83 |
|
| 84 |
def pick_latest(cands=None):
|
| 85 |
-
"""
|
| 86 |
-
|
| 87 |
cands = list_candidates() if cands is None else cands
|
| 88 |
|
| 89 |
-
def
|
| 90 |
r = c["run"]
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
| 96 |
|
| 97 |
-
if not
|
|
|
|
| 98 |
raise RuntimeError(f"no eligible .pt checkpoints in {MODEL_REPO}/checkpoints")
|
| 99 |
-
|
| 100 |
-
pool = [c for c in cands if tier(c) == best_tier]
|
| 101 |
-
pool.sort(key=lambda c: (c["date"], c["step"]), reverse=True)
|
| 102 |
return pool[0]
|
| 103 |
|
| 104 |
|
|
|
|
| 82 |
|
| 83 |
|
| 84 |
def pick_latest(cands=None):
|
| 85 |
+
"""Highest step wins. Skip RELEASE, smoke, and pair-probe runs.
|
| 86 |
+
Date is only a tie-break so a newer small probe cannot hide the tip."""
|
| 87 |
cands = list_candidates() if cands is None else cands
|
| 88 |
|
| 89 |
+
def skip(c):
|
| 90 |
r = c["run"]
|
| 91 |
+
return (
|
| 92 |
+
r == "RELEASE"
|
| 93 |
+
or r.startswith("gpu_smoke")
|
| 94 |
+
or "pairs" in r
|
| 95 |
+
or "prompt" in r
|
| 96 |
+
or c["step"] < 0
|
| 97 |
+
)
|
| 98 |
|
| 99 |
+
pool = [c for c in cands if not skip(c)]
|
| 100 |
+
if not pool:
|
| 101 |
raise RuntimeError(f"no eligible .pt checkpoints in {MODEL_REPO}/checkpoints")
|
| 102 |
+
pool.sort(key=lambda c: (c["step"], c["date"]), reverse=True)
|
|
|
|
|
|
|
| 103 |
return pool[0]
|
| 104 |
|
| 105 |
|