Add classify() and a convert-time embedding stamp - #69
Open
Lazarus-931 wants to merge 2 commits into
Open
Conversation
classify(config, model_path) returns {is_embedding, modality} in three steps:
1. an explicit config["mlx_embeddings"] stamp written by convert (authoritative;
the only signal that separates an embedder from an identically-architected
generative model, e.g. Qwen3-Embedding vs Qwen3 chat);
2. a maintained set of embedding model_types that have no generative twin;
3. a sentence-transformers pooling fallback for un-labeled/un-stamped models.
convert now stamps kind+modality onto converted models. Types shared with
chat/VLM models (qwen3, qwen3_vl, gemma3_text, lfm2) are intentionally left to
the stamp/pooling path since the type alone cannot disambiguate them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wanted to integrate mlx-embeddings as a provider behind nativ, just as a api provider for embedding.
But an issue is that vlm and emb. simultaneously exist in this library, this pr allows me to push a pr up to nativ( they will simply be accessible through api ) that will be able to reference their config key to permit embedding api call.
this pr just labels existing embedding models, and for future included ones, has a function(
classify) to label themcc: @Blaizzy