thefinalboss commited on
Commit
b26ca78
·
verified ·
1 Parent(s): a588800

Load the highest-step checkpoint, not the newest probe

Browse files
Files changed (1) hide show
  1. app.py +13 -12
app.py CHANGED
@@ -82,23 +82,24 @@ def list_candidates():
82
 
83
 
84
  def pick_latest(cands=None):
85
- """Tier 1: checkpoints/gpu_* (not gpu_smoke*); tier 2: other non-RELEASE runs;
86
- tier 3: gpu_smoke*. Within a tier: newest last-commit date, then highest step."""
87
  cands = list_candidates() if cands is None else cands
88
 
89
- def tier(c):
90
  r = c["run"]
91
- if r.startswith("gpu_smoke"):
92
- return 2
93
- if r.startswith("gpu_"):
94
- return 0
95
- return 1
 
 
96
 
97
- if not cands:
 
98
  raise RuntimeError(f"no eligible .pt checkpoints in {MODEL_REPO}/checkpoints")
99
- best_tier = min(tier(c) for c in cands)
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