Instructions to use google/embeddinggemma-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/embeddinggemma-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="google/embeddinggemma-2")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("google/embeddinggemma-2") model = AutoModel.from_pretrained("google/embeddinggemma-2", device_map="auto") - sentence-transformers
How to use google/embeddinggemma-2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("google/embeddinggemma-2") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
I make a local photo and video search app using EmbeddingGemma 2
I’ve been using EmbeddingGemma 2 to build an open source desktop app for searching local photos and short videos with text or a reference image.
It uses the ONNX Community conversion, defaults to Q8, and supports videos up to 32 seconds. Processing runs locally. Installers are available for macOS and Windows, with a native CoreML GPU backend for Apple Silicon.
Sharing it here as an example application of the model. Feedback on the implementation is welcome.
Thanks for sharing this as a working example. Local processing throughout, the ONNX Community conversion defaulting to Q8, and video support up to 32 seconds make the design clear, and the native CoreML GPU backend for Apple Silicon alongside macOS and Windows installers gives it a concrete local lane to test. Field notes on search quality over large local libraries would be useful data from here.