Commit 398252e
fix(load): only fall back to text-only for VLM checkpoint mismatches
Review on #173: `catch where !self.vision` caught every error, so a download
failure or a CancellationError triggered a second, LLM load attempt and then
surfaced a confusing error. The fallback now requires
isVLMCheckpointMismatch(error): a DecodingError, an MLXNN UpdateError
(unhandledKeys, keyNotFound, mismatchedSize, ...), or a ModelFactoryError
for an unsupported model/processor type or an undecodable/invalid config.
Every other error propagates unchanged.
VLMFallbackTests covers the fallback cases (missing image_mean, unhandled
weight keys, unsupported model type) and the pass-through cases
(cancellation, URLError, missing config file).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 5eecf22 commit 398252e
2 files changed
Lines changed: 72 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
208 | 230 | | |
209 | 231 | | |
210 | 232 | | |
| |||
904 | 926 | | |
905 | 927 | | |
906 | 928 | | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
912 | 935 | | |
913 | 936 | | |
914 | 937 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments