nomic-ai / nomic-bert-2048

huggingface.co
Total runs: 1.9K
24-hour runs: 0
7-day runs: -118
30-day runs: 88
Model's Last Updated: April 29 2025
fill-mask

Introduction of nomic-bert-2048

Model Details of nomic-bert-2048

nomic-bert-2048: A 2048 Sequence Length Pretrained BERT

nomic-bert-2048 is a BERT model pretrained on wikipedia and bookcorpus with a max sequence length of 2048.

We make several modifications to our BERT training procedure similar to MosaicBERT . Namely, we add:

We evaluate the quality of nomic-bert-2048 on the standard GLUE benchmark. We find it performs comparably to other BERT models but with the advantage of a significantly longer context length.

Model Bsz Steps Seq Avg Cola SST2 MRPC STSB QQP MNLI QNLI RTE
NomicBERT 4k 100k 2048 0.84 0.50 0.93 0.88 0.90 0.92 0.86 0.92 0.82
RobertaBase 8k 500k 512 0.86 0.64 0.95 0.90 0.91 0.92 0.88 0.93 0.79
JinaBERTBase 4k 100k 512 0.83 0.51 0.95 0.88 0.90 0.81 0.86 0.92 0.79
MosaicBERT 4k 178k 128 0.85 0.59 0.94 0.89 0.90 0.92 0.86 0.91 0.83
Pretraining Data

We use BookCorpus and a 2023 dump of wikipedia . We pack and tokenize the sequences to 2048 tokens. If a document is shorter than 2048 tokens, we append another document until it fits 2048 tokens. If a document is greater than 2048 tokens, we split it across multiple documents. We release the dataset here

Usage

from transformers import AutoModelForMaskedLM, AutoConfig, AutoTokenizer, pipeline

tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') # `nomic-bert-2048` uses the standard BERT tokenizer

config = AutoConfig.from_pretrained('nomic-ai/nomic-bert-2048', trust_remote_code=True) # the config needs to be passed in
model = AutoModelForMaskedLM.from_pretrained('nomic-ai/nomic-bert-2048',config=config, trust_remote_code=True)

# To use this model directly for masked language modeling
classifier = pipeline('fill-mask', model=model, tokenizer=tokenizer,device="cpu")

print(classifier("I [MASK] to the store yesterday."))

To finetune the model for a Sequence Classification task, you can use the following snippet

from transformers import AutoConfig, AutoModelForSequenceClassification
model_path = "nomic-ai/nomic-bert-2048"
config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
# strict needs to be false here since we're initializing some new params
model = AutoModelForSequenceClassification.from_pretrained(model_path, config=config, trust_remote_code=True, strict=False)

Join the Nomic Community

Runs of nomic-ai nomic-bert-2048 on huggingface.co

1.9K
Total runs
0
24-hour runs
-57
3-day runs
-118
7-day runs
88
30-day runs

More Information About nomic-bert-2048 huggingface.co Model

More nomic-bert-2048 license Visit here:

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

nomic-bert-2048 huggingface.co

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

nomic-bert-2048 huggingface.co Url

https://huggingface.co/nomic-ai/nomic-bert-2048

nomic-ai nomic-bert-2048 online free

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

nomic-ai nomic-bert-2048 online free url in huggingface.co:

https://huggingface.co/nomic-ai/nomic-bert-2048

nomic-bert-2048 install

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

nomic-bert-2048 install url in huggingface.co:

https://huggingface.co/nomic-ai/nomic-bert-2048

Url of nomic-bert-2048

nomic-bert-2048 huggingface.co Url

Provider of nomic-bert-2048 huggingface.co

nomic-ai
ORGANIZATIONS

Other API from nomic-ai

huggingface.co

Total runs: 2.0K
Run Growth: -110
Growth Rate: -5.42%
Updated:April 08 2024
huggingface.co

Total runs: 833
Run Growth: -253
Growth Rate: -30.37%
Updated:May 25 2023