DeepMount00 / ModernBERT-base-ita

huggingface.co
Total runs: 95
24-hour runs: 0
7-day runs: 4
30-day runs: 50
Model's Last Updated: January 14 2025
fill-mask

Introduction of ModernBERT-base-ita

Model Details of ModernBERT-base-ita

ModernBERT

Table of Contents
  1. Model Summary
  2. Usage
  3. Evaluation
  4. Limitations
  5. Training
  6. License
  7. Citation
Model Summary

ModernBERT is a modernized bidirectional encoder-only Transformer model (BERT-style) pre-trained on 2 trillion tokens of English and code data with a native context length of up to 8,192 tokens. ModernBERT leverages recent architectural improvements such as:

  • Rotary Positional Embeddings (RoPE) for long-context support.
  • Local-Global Alternating Attention for efficiency on long inputs.
  • Unpadding and Flash Attention for efficient inference.

ModernBERT’s native long context length makes it ideal for tasks that require processing long documents, such as retrieval, classification, and semantic search within large corpora. The model was trained on a large corpus of text and code, making it suitable for a wide range of downstream tasks, including code retrieval and hybrid (text + code) semantic search.

It is available in the following sizes:

For more information about ModernBERT, we recommend our release blog post for a high-level overview, and our arXiv pre-print for in-depth information.

ModernBERT is a collaboration between Answer.AI , LightOn , and friends.

Usage

You can use these models directly with the transformers library. Until the next transformers release, doing so requires installing transformers from main:

pip install git+https://github.com/huggingface/transformers.git

Since ModernBERT is a Masked Language Model (MLM), you can use the fill-mask pipeline or load it via AutoModelForMaskedLM . To use ModernBERT for downstream tasks like classification, retrieval, or QA, fine-tune it following standard BERT fine-tuning recipes.

⚠️ If your GPU supports it, we recommend using ModernBERT with Flash Attention 2 to reach the highest efficiency. To do so, install Flash Attention as follows, then use the model as normal:

pip install flash-attn

Using AutoModelForMaskedLM :

from transformers import AutoTokenizer, AutoModelForMaskedLM

model_id = "DeepMount00/ModernBERT-base-ita"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForMaskedLM.from_pretrained(model_id)

text = "La capitale dell'Italia è [MASK]."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)

# To get predictions for the mask:
masked_index = inputs["input_ids"][0].tolist().index(tokenizer.mask_token_id)
predicted_token_id = outputs.logits[0, masked_index].argmax(axis=-1)
predicted_token = tokenizer.decode(predicted_token_id)
print("Predicted token:", predicted_token)
# Predicted token:  Paris

Using a pipeline:

import torch
from transformers import pipeline
from pprint import pprint

pipe = pipeline(
    "fill-mask",
    model="answerdotai/ModernBERT-base",
    torch_dtype=torch.bfloat16,
)

input_text = "He walked to the [MASK]."
results = pipe(input_text)
pprint(results)

Note: ModernBERT does not use token type IDs, unlike some earlier BERT models. Most downstream usage is identical to standard BERT models on the Hugging Face Hub, except you can omit the token_type_ids parameter.

Evaluation

We evaluate ModernBERT across a range of tasks, including natural language understanding (GLUE), general retrieval (BEIR), long-context retrieval (MLDR), and code retrieval (CodeSearchNet and StackQA).

Key highlights:

  • On GLUE, ModernBERT-base surpasses other similarly-sized encoder models, and ModernBERT-large is second only to Deberta-v3-large.
  • For general retrieval tasks, ModernBERT performs well on BEIR in both single-vector (DPR-style) and multi-vector (ColBERT-style) settings.
  • Thanks to the inclusion of code data in its training mixture, ModernBERT as a backbone also achieves new state-of-the-art code retrieval results on CodeSearchNet and StackQA.
Limitations

ModernBERT’s training data is primarily English and code, so performance may be lower for other languages. While it can handle long sequences efficiently, using the full 8,192 tokens window may be slower than short-context inference. Like any large language model, ModernBERT may produce representations that reflect biases present in its training data. Verify critical or sensitive outputs before relying on them.

License

We release the ModernBERT model architectures, model weights, training codebase under the Apache 2.0 license.

Citation

If you use ModernBERT in your work, please cite:

@misc{modernbert,
      title={Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference}, 
      author={Benjamin Warner and Antoine Chaffin and Benjamin Clavié and Orion Weller and Oskar Hallström and Said Taghadouini and Alexis Gallagher and Raja Biswas and Faisal Ladhak and Tom Aarsen and Nathan Cooper and Griffin Adams and Jeremy Howard and Iacopo Poli},
      year={2024},
      eprint={2412.13663},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2412.13663}, 
}

Runs of DeepMount00 ModernBERT-base-ita on huggingface.co

95
Total runs
0
24-hour runs
0
3-day runs
4
7-day runs
50
30-day runs

More Information About ModernBERT-base-ita huggingface.co Model

More ModernBERT-base-ita license Visit here:

https://choosealicense.com/licenses/apache-2.0

ModernBERT-base-ita huggingface.co

ModernBERT-base-ita huggingface.co is an AI model on huggingface.co that provides ModernBERT-base-ita's model effect (), which can be used instantly with this DeepMount00 ModernBERT-base-ita model. huggingface.co supports a free trial of the ModernBERT-base-ita model, and also provides paid use of the ModernBERT-base-ita. Support call ModernBERT-base-ita model through api, including Node.js, Python, http.

ModernBERT-base-ita huggingface.co Url

https://huggingface.co/DeepMount00/ModernBERT-base-ita

DeepMount00 ModernBERT-base-ita online free

ModernBERT-base-ita huggingface.co is an online trial and call api platform, which integrates ModernBERT-base-ita's modeling effects, including api services, and provides a free online trial of ModernBERT-base-ita, you can try ModernBERT-base-ita online for free by clicking the link below.

DeepMount00 ModernBERT-base-ita online free url in huggingface.co:

https://huggingface.co/DeepMount00/ModernBERT-base-ita

ModernBERT-base-ita install

ModernBERT-base-ita is an open source model from GitHub that offers a free installation service, and any user can find ModernBERT-base-ita on GitHub to install. At the same time, huggingface.co provides the effect of ModernBERT-base-ita install, users can directly use ModernBERT-base-ita installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

ModernBERT-base-ita install url in huggingface.co:

https://huggingface.co/DeepMount00/ModernBERT-base-ita

Url of ModernBERT-base-ita

ModernBERT-base-ita huggingface.co Url

Provider of ModernBERT-base-ita huggingface.co

DeepMount00
ORGANIZATIONS

Other API from DeepMount00

huggingface.co

Total runs: 1.3K
Run Growth: 1.0K
Growth Rate: 75.00%
Updated:April 25 2024