Downloads · 30 days
95
26% of all-time downloads
mlx-community/tasksource-ModernBERT-base-embed-6bit
tasksource-ModernBERT-base-embed-6bit is a sentence similarity model from mlx-community. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
The Model mlx-community/tasksource-ModernBERT-base-embed-6bit was converted to MLX format from tasksource/ModernBERT-base-embed using mlx-lm version 0.0.3.
Downloads · 30 days
95
26% of all-time downloads
All-time downloads
372
Public
Parameters
149M
121 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors121 MB · 97%
How the weights are stored.
U32149M · 100%
From the Hugging Face model README
The Model mlx-community/tasksource-ModernBERT-base-embed-6bit was converted to MLX format from tasksource/ModernBERT-base-embed using mlx-lm version 0.0.3.
pip install mlx-embeddings
from mlx_embeddings import load, generate
import mlx.core as mx
model, tokenizer = load("mlx-community/tasksource-ModernBERT-base-embed-6bit")
# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
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)