Repository navigation
Add extensible VLM processor loading rules - #565
davidkoski merged 2 commits into
Conversation
|
This PR Action check is failing because 1441444 targeting Xcode 27 beta 5 while the hosted xcode-27 runner is still on beta 4. It now affects every PR tested against main. |
|
We can just treat the xcode27 as non-blocking for now (I will just verify that it is the expected error). |
|
|
||
| Some repositories omit processor metadata, or declare a generic processor that is not the | ||
| right implementation for their model type. An external model package can handle either case | ||
| without changing `VLMModelFactory`: |
There was a problem hiding this comment.
It is curious that there are several VLMs in this situation and no LLMs.
| `processor_config.json` always wins over a generated fallback. Processor type resolution is | ||
| applied afterward and can supply a missing `processor_class` or correct an incorrect one. | ||
| For isolated applications and tests, pass a separate | ||
| `VLMProcessorLoadingRegistry` to `VLMModelFactory` instead of registering globally. |
| /// `preprocessor_config.json` nor `processor_config.json` exists. Processor type resolvers are | ||
| /// consulted after a configuration has been selected, so they can supply missing metadata or | ||
| /// correct metadata shipped by a checkpoint. | ||
| public protocol VLMProcessorLoadingResolver: Sendable { |
There was a problem hiding this comment.
This looks great -- if we need more hooks we can easily add more methods with nil-returning defaults in the future.
davidkoski
left a comment
There was a problem hiding this comment.
This looks awesome! Thank you!
* Add extensible VLM processor loading rules
Proposed changes
Fixes #547.
External model packages could register their models and processors, but could not control how processor metadata was loaded. This forced model-specific fixes to be hard-coded inside
VLMModelFactory.This PR introduces a public processor-loading resolver registry. External packages can now:
Existing Qwen3.5, Mistral3, and Gemma4 special cases now use the same public mechanism. Repository configuration files remain authoritative, and fallbacks are only evaluated when those files are absent.
Checklist
pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes