How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("fill-mask", model="mlx-community/answerdotai-ModernBERT-Large-Instruct-8bit")
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForMaskedLM

tokenizer = AutoTokenizer.from_pretrained("mlx-community/answerdotai-ModernBERT-Large-Instruct-8bit")
model = AutoModelForMaskedLM.from_pretrained("mlx-community/answerdotai-ModernBERT-Large-Instruct-8bit", device_map="auto")
Quick Links

mlx-community/answerdotai-ModernBERT-Large-Instruct-8bit

The Model mlx-community/answerdotai-ModernBERT-Large-Instruct-8bit was converted to MLX format from answerdotai/ModernBERT-Large-Instruct using mlx-lm version 0.0.3.

Use with mlx

pip install mlx-embeddings
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/answerdotai-ModernBERT-Large-Instruct-8bit")

# 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)

Downloads last month
17
Safetensors
Model size
0.4B params
Tensor type
F16
ยท
U32
ยท
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Collection including mlx-community/answerdotai-ModernBERT-Large-Instruct-8bit