Sentence Similarity
sentence-transformers
Safetensors
gemma3_text
feature-extraction
text-embeddings-inference
Eval Results
Instructions to use google/embeddinggemma-300m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use google/embeddinggemma-300m with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("google/embeddinggemma-300m") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Inference
- Notebooks
- Google Colab
- Kaggle
Training supported by MS-SWIFT framework
#18
by tastelikefeet - opened
Check these scripts: https://github.com/modelscope/ms-swift/tree/main/examples/train/embedding
And with model-id:
...
--model google/embeddinggemma-300m \
--use_hf true \
...
or with modelscope:
...
--model google/embeddinggemma-300m \
--use_hf false \
...
We support multiple loss types, cosine-similarity, contrastive, infonce, etc.
Embedding training instructions can be found here:
https://swift.readthedocs.io/en/latest/BestPractices/Embedding.html
tastelikefeet changed discussion title from Training supported with MS-SWIFT framework to Training supported by MS-SWIFT framework
Hi @tastelikefeet ,
Welcome to Gemma family of open source models, thanks for your contribution. I really appreciates that your contribution to run the model with provided script. I would loike to try to run the model with above provided script.
Thanks.
MS-SWIFT does not support Matryoshka Representation Learning (MRL) loss?