Instructions to use answerdotai/ModernBERT-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use answerdotai/ModernBERT-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="answerdotai/ModernBERT-base")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("answerdotai/ModernBERT-base") model = AutoModelForMaskedLM.from_pretrained("answerdotai/ModernBERT-base") - Notebooks
- Google Colab
- Kaggle
ValueError: The checkpoint you are trying to load has model type `modernbert`
#37
by Sengil - opened
ValueError: 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.
Until the next transformers release, you must install it directly from GitHub like so to use ModernBert:
pip install git+https://github.com/huggingface/transformers.git
- Tom Aarsen
Now you need to upgrade to Transformers 4.48: pip install -U transformers>=4.48
bwarner changed discussion status to closed