Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

google
/
embeddinggemma-2

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
Model card Files Files and versions
xet
Community
3

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
embeddinggemma-2 / 1_Pooling
90 Bytes
Ctrl+K
Ctrl+K
  • 6 contributors
History: 1 commit
irbg's picture
irbg
bebechien's picture
bebechien
MaartenGr's picture
MaartenGr
hschechter's picture
hschechter
jandonov's picture
jandonov
sahildua2305's picture
sahildua2305
Super-squash branch 'main' using huggingface_hub
914f7f8 about 8 hours ago
  • config.json
    90 Bytes
    Super-squash branch 'main' using huggingface_hub about 8 hours ago