Repository navigation
EmbeddingGemma-2 support - #246
danielhanchen wants to merge 3 commits into
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 061e554f5b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]: | ||
| # same towers as Gemma4, but the tensor names have no "model." prefix | ||
| yield from super().modify_tensors(data_torch, "model." + name, bid) |
There was a problem hiding this comment.
Filter text weights before converting the multimodal projector
When --mmproj is used on an EmbeddingGemma2 checkpoint, its text tensors have bare names such as layers.*, ple.*, and embedding_projection, so the inherited MmprojModel.filter_tensors() does not discard them because it only recognizes language_model.* as text. This method then prefixes every surviving name with model. and the superclass routes every non-audio tensor through the vision mapping, causing conversion to fail on the first text tensor with an unmappable-name error. Override filter_tensors() to retain only the vision/audio tower tensors before this renaming.
Useful? React with 👍 / 👎.
|
Superseded by #247, which carries the same commits on base/upstream-b9a5a00b8 for the pin set instead of putting source into master. |
Summary
EmbeddingGemma 2 support (google/embeddinggemma-2), by @ngxson.
The two commits by @ngxson are cherry-picked unchanged:
model: add embeddinggemma2: thegemma-embedding2architecture, its graph and the converter.add mtmd support: images and audio through the existing Gemma 4 vision and audio projectors.Together they come to +324 / -2 across 10 files, the same lines as the upstream change.
One small extra commit adapts the graph to this tree, which does not have two newer upstream helpers yet:
load_swa_patternis written out inline.build_inp_embd(tok_embd, scale)becomesbuild_inp_embd+ggml_scale, matchinggemma4.cpphere.Testing
llama-embeddingon the BF16 GGUF, compared with a build of the upstream change:Both give 768-dim, mean-pooled output.