Feature Extraction
Transformers
Safetensors
sentence-transformers
multilingual
embedding_gemma2
embedding
multimodal-embedding
multimodal
vision
audio
video
image-feature-extraction
audio-feature-extraction
video-feature-extraction
sentence-similarity
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
Download config_sentence_transformers.json from google/embeddinggemma-2: direct link, hf CLI and curl.
- Browser
- Download file 1.57 kB
-
https://huggingface.co/google/embeddinggemma-2/resolve/main/config_sentence_transformers.json
- Command line
-
hf download hf://google/embeddinggemma-2/config_sentence_transformers.json
-
curl -L -o config_sentence_transformers.json https://huggingface.co/google/embeddinggemma-2/resolve/main/config_sentence_transformers.json
1.57 kB
| { | |
| "__version__": { | |
| "pytorch": "2.14.0+cu130", | |
| "sentence_transformers": "6.1.0", | |
| "transformers": "5.18.0.dev0" | |
| }, | |
| "default_prompt_name": null, | |
| "model_type": "SentenceTransformer", | |
| "prompts": { | |
| "BitextMining": "task: search result | query: ", | |
| "Classification": "task: classification | query: ", | |
| "Clustering": "task: clustering | query: ", | |
| "CodeRetrieval": "task: code retrieval | query: ", | |
| "Document": "title: none | text: ", | |
| "FactChecking": "task: fact checking | query: ", | |
| "InstructionRetrieval": "task: code retrieval | query: ", | |
| "MultilabelClassification": "task: classification | query: ", | |
| "PairClassification": "task: sentence similarity | query: ", | |
| "QuestionAnswering": "task: question answering | query: ", | |
| "Reranking": "task: search result | query: ", | |
| "Retrieval": "task: search result | query: ", | |
| "Retrieval-document": "title: none | text: ", | |
| "Retrieval-query": "task: search result | query: ", | |
| "STS": "task: sentence similarity | query: ", | |
| "SearchQuery": "task: search result | query: ", | |
| "SentenceSimilarity": "task: sentence similarity | query: ", | |
| "Summarization": "task: sentence similarity | query: ", | |
| "document": "title: none | text: ", | |
| "query": "task: search result | query: " | |
| }, | |
| "requirements": { | |
| "sentence-transformers": { | |
| "reason": "Older versions ignore the order of multimodal dict inputs and cannot put several images or texts into a single embedding.", | |
| "specifier": ">=6.1.0" | |
| } | |
| }, | |
| "similarity_fn_name": "cosine" | |
| } | |