Instructions to use answerdotai/ModernBERT-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use answerdotai/ModernBERT-large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="answerdotai/ModernBERT-large")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("answerdotai/ModernBERT-large", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Getting error on inference api
#8
by pulkitmehtawork - opened
The checkpoint you are trying to load has model type modernbert but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.
pulkitmehtawork changed discussion title from Getting error on inference end pt to Getting error on inference api
Hello!
The modernbert architecture is extremely new, so much so that it hasn't yet been included in a transformers. Because of that, you'll have to install the unreleased version directly from GitHub:
pip install git+https://github.com/huggingface/transformers.git
Then your script should work correctly.
- Tom Aarsen
Thanks Tom
pulkitmehtawork changed discussion status to closed