Run this model with HF Jobs
Run OrbitLabsCo/embeddinggemma-300m-8bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/OrbitLabsCo/embeddinggemma-300m-8bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OrbitLabsCo/embeddinggemma-300m-8bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use OrbitLabsCo/embeddinggemma-300m-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use OrbitLabsCo/embeddinggemma-300m-8bit with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("OrbitLabsCo/embeddinggemma-300m-8bit") 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] - MLX
How to use OrbitLabsCo/embeddinggemma-300m-8bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download OrbitLabsCo/embeddinggemma-300m-8bit --local-dir embeddinggemma-300m-8bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
mlx-community/embeddinggemma-300m-8bit
The Model mlx-community/embeddinggemma-300m-8bit was converted to MLX format from google/embeddinggemma-300m-qat-q8_0-unquantized using mlx-lm version 0.0.4.
Use with mlx
pip install mlx-embeddings
from mlx_embeddings import load, generate
import mlx.core as mx
model, tokenizer = load("mlx-community/embeddinggemma-300m-8bit")
# For text embedding
sentences = [
"task: sentence similarity | query: Nothing really matters.",
"task: sentence similarity | query: The dog is barking.",
"task: sentence similarity | query: The dog is barking.",
]
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='mlx')
# Compute token embeddings
input_ids = encoded_input['input_ids']
attention_mask = encoded_input['attention_mask']
output = model(input_ids, attention_mask)
embeddings = output.text_embeds # Normalized embeddings
# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)
print("Similarity matrix between texts:")
print(similarity_matrix)
# You can use these task-specific prefixes for different tasks
task_prefixes = {
"BitextMining": "task: search result | query: ",
"Clustering": "task: clustering | query: ",
"Classification": "task: classification | query: ",
"MultilabelClassification": "task: classification | query: ",
"PairClassification": "task: sentence similarity | query: ",
"InstructionRetrieval": "task: code retrieval | query: ",
"Reranking": "task: search result | query: ",
"Retrieval": "task: search result | query: ",
"Retrieval-query": "task: search result | query: ",
"Retrieval-document": "title: none | text: ",
"STS": "task: sentence similarity | query: ",
"Summarization": "task: summarization | query: ",
"document": "title: none | text: "
}
- Downloads last month
- 41
Model size
0.3B params
Tensor type
U32
·
F16 ·
Hardware compatibility
Log In to add your hardware
Quantized