From: intfloat <huggingface.co/intfloat>Newsgroups: alt.freeweights.embedSubject:

e5-base-v2

Date: 2026-11-14Commit: f52bf8eSigned: 2DC28CC7B26A283B ✓

Sentence similarity model with 109M parameters. Onnx and openvino and safetensors weights, 2.19 GB in all. Published by intfloat under MIT.

109M params2.19GBe5-base-v2onnx openvino safetensorspermissive
FactsParams109MSize2.19 GBFormatsonnx, openvino, safetensorsTasksentence similarityLicenseMITFrom sourcepermissive
$ fw get intfloat/e5-base-v2
# manifest sha256 fed77b944037… · 2.19 GB · 24 files
$ fw verify ./e5-base-v2 intfloat/e5-base-v2
From sourceHosted (signed)intfloat/e5-base-v2Last check: 2026-11-14 21:09 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Evaluate with

Overview

Size
2.19 GB
Weights
438 MB (safetensors)
Parameters
109M
Formats
onnx, openvino, safetensors
Task
sentence similarity
License
MIT (permissive)
Files
24, each with a sha256
Publisher
intfloat
Added
2026-11-14
Section
alt.freeweights.embed
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-14 21:09 UTCpassed

Model card

From the publisher at commit f52bf8e. Shown as plain text with links; images open at the publisher.

E5-base-v2#

Text Embeddings by Weakly-Supervised Contrastive Pre-training. Liang Wang, Nan Yang, Xiaolong Huang, Binxing Jiao, Linjun Yang, Daxin Jiang, Rangan Majumder, Furu Wei, arXiv 2022

This model has 12 layers and the embedding size is 768.

Usage#

Below is an example to encode queries and passages from the MS-MARCO passage ranking dataset.

import torch.nn.functional as F

from torch import Tensor
from transformers import AutoTokenizer, AutoModel


def average_pool(last_hidden_states: Tensor,
                 attention_mask: Tensor) -> Tensor:
    last_hidden = last_hidden_states.masked_fill(~attention_mask[..., None].bool(), 0.0)
    return last_hidden.sum(dim=1) / attention_mask.sum(dim=1)[..., None]


# Each input text should start with "query: " or "passage: ".
# For tasks other than retrieval, you can simply use the "query: " prefix.
input_texts = ['query: how much protein should a female eat',
               'query: summit define',
               "passage: As a general guideline, the CDC's average requirement of protein for women ages 19 to 70 is 46 grams per day. But, as you can see from this chart, you'll need to increase that if you're expecting or training for a marathon. Check out the chart below to see how much protein you should be eating each day.",
               "passage: Definition of summit for English Language Learners. : 1  the highest point of a mountain : the top of a mountain. : 2  the highest level. : 3  a meeting or series of meetings between the leaders of two or more governments."]

tokenizer = AutoTokenizer.from_pretrained('intfloat/e5-base-v2')
model = AutoModel.from_pretrained('intfloat/e5-base-v2')

# Tokenize the input texts
batch_dict = tokenizer(input_texts, max_length=512, padding=True, truncation=True, return_tensors='pt')

outputs = model(**batch_dict)
embeddings = average_pool(outputs.last_hidden_state, batch_dict['attention_mask'])

# normalize embeddings
embeddings = F.normalize(embeddings, p=2, dim=1)
scores = (embeddings[:2] @ embeddings[2:].T) * 100
print(scores.tolist())

Training Details#

Please refer to our paper at https://arxiv.org/pdf/2212.03533.pdf.

Benchmark Evaluation#

Check out unilm/e5 to reproduce evaluation results on the BEIR and MTEB benchmark.

Support for Sentence Transformers#

Below is an example for usage with sentence_transformers.

from sentence_transformers import SentenceTransformer
model = SentenceTransformer('intfloat/e5-base-v2')
input_texts = [
    'query: how much protein should a female eat',
    'query: summit define',
    "passage: As a general guideline, the CDC's average requirement of protein for women ages 19 to 70 is 46 grams per day. But, as you can see from this chart, you'll need to increase that if you're expecting or training for a marathon. Check out the chart below to see how much protein you should be eating each day.",
    "passage: Definition of summit for English Language Learners. : 1  the highest point of a mountain : the top of a mountain. : 2  the highest level. : 3  a meeting or series of meetings between the leaders of two or more governments."
]
embeddings = model.encode(input_texts, normalize_embeddings=True)

Package requirements

pip install sentence_transformers~=2.2.2

Contributors: michaelfeil

FAQ#

1. Do I need to add the prefix "query: " and "passage: " to input texts?

Yes, this is how the model is trained, otherwise you will see a performance degradation.

Here are some rules of thumb:

  • Use "query: " and "passage: " correspondingly for asymmetric tasks such as passage retrieval in open QA, ad-hoc information retrieval.
  • Use "query: " prefix for symmetric tasks such as semantic similarity, paraphrase retrieval.
  • Use "query: " prefix if you want to use embeddings as features, such as linear probing classification, clustering.

2. Why are my reproduced results slightly different from reported in the model card?

Different versions of transformers and pytorch could cause negligible but non-zero performance differences.

3. Why does the cosine similarity scores distribute around 0.7 to 1.0?

This is a known and expected behavior as we use a low temperature 0.01 for InfoNCE contrastive loss.

For text embedding tasks like text retrieval or semantic similarity, what matters is the relative order of the scores instead of the absolute values, so this should not be an issue.

Citation#

If you find our paper or models helpful, please consider cite as follows:

@article{wang2022text,
  title={Text Embeddings by Weakly-Supervised Contrastive Pre-training},
  author={Wang, Liang and Yang, Nan and Huang, Xiaolong and Jiao, Binxing and Yang, Linjun and Jiang, Daxin and Majumder, Rangan and Wei, Furu},
  journal={arXiv preprint arXiv:2212.03533},
  year={2022}
}

Limitations#

This model only works for English texts. Long texts will be truncated to at most 512 tokens.

Files

24 files · 2.19 GBWeights 438 MB (safetensors). Sizes and sha256 from the signed manifest.
Show all 24 files with their sha256
FileSizesha256
.gitattributes1.48 KBdb7c0371f46f0840b8f25794c1e3321c9b5820a8cb6ba9694a46fc64b8fae5a6
1_Pooling/config.json200 Bf586ab6c734af7b8d14d898bfa7faa886f23b46f86dd1730514309893af13d75
README.md67.6 KB127d92b493963c5e7f74fcad5190546e19e404e5ff5b5c0c606dbcda57ca530e
config.json650 B01cc39aa39538a8179aa131c8a16adc03b506c92009f091502e4eb0c702f5f78
model.safetensors438 MBd0d559c47d5f71b1d280b13b62a2657f3e3bc70c0786f9ab91a36545e6a8f693
modules.json387 Bc6e29747481e8b5dd2b58401966aeac910de39092f90cda9a704b1545f902b04
onnx/config.json632 Beedcf6117fdeb234759a2d2ee684feaef6cb4891a5c54eb4504c61538e029fa4
onnx/model.onnx436 MB157f97ef1957d34f52efa26f8031371bf9043acc45460cec7ebe94631ac0e96b
onnx/model_O4.onnx218 MBaf23dd830162f92b07928dda24ef9d023fd1792ff5535a47e111b4557efa1e74
onnx/model_qint8_avx512_vnni.onnx110 MBf2ff55f62dfca9ce0f4a5656ae0b1571b9fbc5e15eda3b2c56dd32f329b2005e
onnx/special_tokens_map.json125 Bb6d346be366a7d1d48332dbc9fdf3bf8960b5d879522b7799ddba59e76237ee3
onnx/tokenizer.json711 KBd241a60d5e8f04cc1b2b3e9ef7a4921b27bf526d9f6050ab90f9267a1f9e5c66
onnx/tokenizer_config.json314 Bae83fa6ca0333117ff12606020af925d648667ef70d92ff7f27d781ba0ca4544
onnx/vocab.txt232 KB07eced375cec144d27c900241f3e339478dec958f92fddbc551f295c992038a3
openvino/openvino_model.bin436 MB813bf62987ce7bf6e9a94d1ff42455376a036ff26463088ca95033d38cf4b880
openvino/openvino_model.xml363 KB16705018270fc1b17d2d0463e3c36e621e9075ec4c0e7f6b6da47265e85f80cb
openvino/openvino_model_qint8_quantized.bin110 MB2d6045bf41cddc50b04c8cb7a47c2142c7f5689bcc9e49c3f00dbc772cd86ab6
openvino/openvino_model_qint8_quantized.xml664 KBadb412cba9e0d45e35ae92f3d1cb29c4cb9bee691f4809f519a2c6c68ba5ee48
pytorch_model.bin438 MB5b119cd34c663c26fcd8bbe82e9873e9a16c6588b9817a4243947a6de478c273
sentence_bert_config.json57 B948201d8329907aae938fa62f9ceeed53f5694dacc2b87b9f3b78b37ee986529
special_tokens_map.json125 Bb6d346be366a7d1d48332dbc9fdf3bf8960b5d879522b7799ddba59e76237ee3
tokenizer.json711 KBd241a60d5e8f04cc1b2b3e9ef7a4921b27bf526d9f6050ab90f9267a1f9e5c66
tokenizer_config.json314 Bae83fa6ca0333117ff12606020af925d648667ef70d92ff7f27d781ba0ca4544
vocab.txt232 KB07eced375cec144d27c900241f3e339478dec958f92fddbc551f295c992038a3
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
f52bf8ec8c pinned now manifest updated, same commit2026-11-14 21:09 UTC24 files · 2.19 GB
f52bf8ec8c2026-11-14 21:09 UTC24 files · 2.19 GB

Use it

$ fw get intfloat/e5-base-v2
# manifest sha256 fed77b944037… · 2.19 GB · 24 files
$ fw verify ./e5-base-v2 intfloat/e5-base-v2
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/intfloat/e5-base-v2.json --dir ./e5-base-v2 $ python3 fw.py verify ./e5-base-v2 ./intfloat__e5-base-v2.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download intfloat/e5-base-v2 --revision f52bf8ec8c7124536f0efb74aca902b2995e5bcd --local-dir ./e5-base-v2
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModel, AutoTokenizer tok = AutoTokenizer.from_pretrained("intfloat/e5-base-v2", revision="f52bf8ec8c7124536f0efb74aca902b2995e5bcd") model = AutoModel.from_pretrained("intfloat/e5-base-v2", revision="f52bf8ec8c7124536f0efb74aca902b2995e5bcd", device_map="auto")
sentence-transformersEmbed text with sentence-transformers.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from sentence_transformers import SentenceTransformer model = SentenceTransformer("intfloat/e5-base-v2", revision="f52bf8ec8c7124536f0efb74aca902b2995e5bcd") vectors = model.encode(["Hello"])

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-14
Text in
README.md
Text sha256
127d92b493963c5e7f74fcad5190546e19e404e5ff5b5c0c606dbcda57ca530e
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: intfloat <huggingface.co/intfloat>Newsgroups: alt.freeweights.embedSubject: e5-base-v2Date: 2026-11-14Commit: f52bf8eSigned: 2DC28CC7B26A283B ✓
Upstream
intfloat/e5-base-v2
Pinned commit
f52bf8ec8c7124536f0efb74aca902b2995e5bcd
Manifest
e5-base-v2.json · .minisig
Manifest sha256
fed77b944037f972a8fa8aa7113e2fca6c4215476cb47402c41c30ba890ce247
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-14 21:09 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/intfloat/e5-base-v2.json $ curl -O https://freeweights.allternit.com/manifests/intfloat/e5-base-v2.json.minisig $ minisign -Vm e5-base-v2.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download intfloat/e5-base-v2
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. e5-base-v2.json. Provenance. Takedown history: none.
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-MiniLM-L6-v1
From: unsloth <huggingface.co/unsloth>Subject: all-MiniLM-L6-v2
From: mlx-community <huggingface.co/mlx-community>Subject: all-MiniLM-L6-v2-4bit
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-mpnet-base-v1
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: allenai-specter
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: bert-base-nli-max-tokens