Instructions to use mlx-community/answerdotai-ModernBERT-base-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mlx-community/answerdotai-ModernBERT-base-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="mlx-community/answerdotai-ModernBERT-base-4bit")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("mlx-community/answerdotai-ModernBERT-base-4bit") model = AutoModelForMaskedLM.from_pretrained("mlx-community/answerdotai-ModernBERT-base-4bit") - MLX
How to use mlx-community/answerdotai-ModernBERT-base-4bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir answerdotai-ModernBERT-base-4bit mlx-community/answerdotai-ModernBERT-base-4bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
Update README.md
Browse files
README.md
CHANGED
|
@@ -13,9 +13,9 @@ pipeline_tag: fill-mask
|
|
| 13 |
inference: false
|
| 14 |
---
|
| 15 |
|
| 16 |
-
# mlx-community/ModernBERT-base-4bit
|
| 17 |
|
| 18 |
-
The Model [mlx-community/ModernBERT-base-4bit](https://huggingface.co/mlx-community/ModernBERT-base-4bit) was converted to MLX format from [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) using mlx-lm version **0.0.3**.
|
| 19 |
|
| 20 |
## Use with mlx
|
| 21 |
|
|
@@ -27,7 +27,7 @@ pip install mlx-embeddings
|
|
| 27 |
from mlx_embeddings import load, generate
|
| 28 |
import mlx.core as mx
|
| 29 |
|
| 30 |
-
model, tokenizer = load("mlx-community/ModernBERT-base-4bit")
|
| 31 |
|
| 32 |
# For text embeddings
|
| 33 |
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
|
|
|
|
| 13 |
inference: false
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# mlx-community/answerdotai-ModernBERT-base-4bit
|
| 17 |
|
| 18 |
+
The Model [mlx-community/answerdotai-ModernBERT-base-4bit](https://huggingface.co/mlx-community/answerdotai-ModernBERT-base-4bit) was converted to MLX format from [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) using mlx-lm version **0.0.3**.
|
| 19 |
|
| 20 |
## Use with mlx
|
| 21 |
|
|
|
|
| 27 |
from mlx_embeddings import load, generate
|
| 28 |
import mlx.core as mx
|
| 29 |
|
| 30 |
+
model, tokenizer = load("mlx-community/answerdotai-ModernBERT-base-4bit")
|
| 31 |
|
| 32 |
# For text embeddings
|
| 33 |
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
|