Instructions to use litert-community/embeddinggemma-300m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use litert-community/embeddinggemma-300m with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("litert-community/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] - Notebooks
- Google Colab
- Kaggle
.task or tflitelm
Hello thank you to the l it community litert!
I would like to ask if it would be possible to make the model available in format task or tflitelm for the AI Edge Gallery application ? It would be a great help for anyone who wants to test and use it directly on their Android phone. Thank you in advance.
Good
4 months later, any update on this?
The .task and .litertlm formats are for LLM models that can be run with LiteRT LM (or the older LLM Inference API). The AI Edge Gallery app is normally for LLMs and it typically uses LiteRT LM and therefore these formats.
EmbeddingGemma is a text embedding model and not an LLM . It produces a vector representations of text. It can be useful in conjunction with other models but it is not possible to chat with it as though it were an LLM. This library is an example of how this model could be used in an app.
Because it is not an LLM, we would need to create a new demo experience in the AI Edge Gallery app to showcase it. I will reach out to our product team to let them know that this is a user priority.