Commit d60cafb
Fix confidence scorer loader misrouting joblib artifacts
load_lightgbm_scorer routed by whether metadata_path was passed: any
metadata_path (explicit or auto-discovered sidecar) forced the raw
LightGBM Booster loader. But train_confidence_scorer exports a
self-contained joblib dict and also offers write_metadata_json, so a
caller with both files who passes metadata_path (exactly what
spec_confidence_runtime_readiness's from_artifact documents) got
'Unknown model format' on the pipeline's own artifact.
Route by artifact content instead: try joblib.load first; fall back to
the Booster loader only when the file is not a joblib pickle. metadata
stays authoritative from the joblib dict; the sidecar/metadata_path is
used only for raw Booster files that cannot carry it.
Adds a regression test loading a joblib dict WITH metadata_path.
Verified end-to-end on a real trained scorer.joblib.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent b614175 commit d60cafb
2 files changed
Lines changed: 48 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
159 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
160 | 169 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
165 | 173 | | |
166 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
167 | 179 | | |
| 180 | + | |
168 | 181 | | |
169 | | - | |
| 182 | + | |
| 183 | + | |
170 | 184 | | |
171 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
172 | 190 | | |
| 191 | + | |
173 | 192 | | |
174 | 193 | | |
175 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
302 | 324 | | |
303 | 325 | | |
304 | 326 | | |
| |||
0 commit comments