You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SigLIP2Model (dimos/models/embedding/siglip2.py), an embedding wrapper for the fixed-resolution SigLIP 2 checkpoints, default google/siglip2-base-patch16-224. It matches SigLIPModel except on the text side: it pads to 64 tokens explicitly (the Gemma tokenizer has no max length, so padding="max_length" alone pads nothing) and lowercases (SigLIP 2 was trained on lowercased text).
Why do we need this?
SigLIP 2 is the successor of the SigLIP v1 embedder used by the localize stack as well meant for general perception workflows.
After testing, it should retire CLIP from the main call sites where CLIP is used.
How to Test
uv run python -c "from dimos.models.embedding.siglip2 import SigLIP2Model; m = SigLIP2Model(); print(m.embed_text('paper box').vector.shape)"
Executed the head wrapper and a dtype-forwarding control against the cached checkpoint, checking parameter precision, storage, and text inference to isolate candidate 0.
Loaded the real model through the unchanged wrapper and ran text inference, showing accepted float16 configuration but float32 parameters and twice the expected parameter storage.
Loaded the same checkpoint through a validation-only dtype-forwarding subclass and ran text inference, showing float16 parameters and exactly half the parameter storage.
The executed harness inventories checked-in tests and compares real-tokenizer preprocessing with isolated negative controls, making the coverage-gap demonstration reproducible.
The executed runner launches inventory and comparison runs with explicit offline environment settings and records each command, working directory and exit code, preserving traceable proof.
The inventory enumerated 552 tracked Python test files and extracted existing embedding-test parametrizations and assertions, confirming that SigLIP2 preprocessing lacks checked-in coverage.
Three runs separately disabled lowercasing, padding or truncation in memory while retaining a mocked fixed-shape encoder, showing that shape-only checks pass despite incorrect preprocessing.
The actual checked-in embed_text method processed mixed-case, short and long inputs through the real cached tokenizer, passing all three preprocessing checks.
The initial run captured correct 64-token output with terminal EOS but failed an overly strict harness prefix assertion, documenting a corrected harness error rather than a product defect.
Executed the head wrapper and a dtype-forwarding control against the cached checkpoint, checking parameter precision, storage, and text inference to isolate candidate 0.
Loaded the real model through the unchanged wrapper and ran text inference, showing accepted float16 configuration but float32 parameters and twice the expected parameter storage.
Loaded the same checkpoint through a validation-only dtype-forwarding subclass and ran text inference, showing float16 parameters and exactly half the parameter storage.
The executed harness inventories checked-in tests and compares real-tokenizer preprocessing with isolated negative controls, making the coverage-gap demonstration reproducible.
The executed runner launches inventory and comparison runs with explicit offline environment settings and records each command, working directory and exit code, preserving traceable proof.
The inventory enumerated 552 tracked Python test files and extracted existing embedding-test parametrizations and assertions, confirming that SigLIP2 preprocessing lacks checked-in coverage.
Three runs separately disabled lowercasing, padding or truncation in memory while retaining a mocked fixed-shape encoder, showing that shape-only checks pass despite incorrect preprocessing.
The actual checked-in embed_text method processed mixed-case, short and long inputs through the real cached tokenizer, passing all three preprocessing checks.
The initial run captured correct 64-token output with terminal EOS but failed an overly strict harness prefix assertion, documenting a corrected harness error rather than a product defect.
Summary
Adds SigLIP2Model for fixed-resolution SigLIP2 checkpoints.
Callers can create image and text embeddings with SigLIP 2.
No blocking issue was established. The change is safe to merge with these non-blocking concerns.
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
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.
What is this feature?
SigLIP2Model(dimos/models/embedding/siglip2.py), an embedding wrapper for the fixed-resolution SigLIP 2 checkpoints, defaultgoogle/siglip2-base-patch16-224. It matchesSigLIPModelexcept on the text side: it pads to 64 tokens explicitly (the Gemma tokenizer has no max length, sopadding="max_length"alone pads nothing) and lowercases (SigLIP 2 was trained on lowercased text).Why do we need this?
SigLIP 2 is the successor of the SigLIP v1 embedder used by the localize stack as well meant for general perception workflows.
After testing, it should retire CLIP from the main call sites where CLIP is used.
How to Test
uv run python -c "from dimos.models.embedding.siglip2 import SigLIP2Model; m = SigLIP2Model(); print(m.embed_text('paper box').vector.shape)"
Which issue(s) does this PR close?
Fixes
Checklist