Hippius
mainsafetensorsPublicapache-2.0sentence-transformerssentence-similarity

archive/paraphrase-multilingual-mpnet-base-v2

sha256:c6a8e489d8c46dcd60cbccf23c0cd630114469f271d53fcfb0f2c779a4fad576·Indexed 26d ago

Parameters

—

Total size

1.0 GB

Files

28

Quantization

—

README.md

5.5 KB

Mirror. This is an unmodified copy of sentence-transformers/paraphrase-multilingual-mpnet-base-v2 at commit 4328cf26390c, mirrored by Hippius on 2026-10-29. Large files were checked against Hugging Face's published SHA-256 before upload (2 verified). License: apache-2.0. All credit to the original authors.

sentence-transformers/paraphrase-multilingual-mpnet-base-v2

This is a sentence-transformers model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.

Usage (Sentence-Transformers)

Using this model becomes easy when you have sentence-transformers installed:

pip install -U sentence-transformers

Then you can use the model like this:

from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]

model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-mpnet-base-v2')
embeddings = model.encode(sentences)
print(embeddings)

Usage (HuggingFace Transformers)

Without sentence-transformers, you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.

from transformers import AutoTokenizer, AutoModel
import torch


# Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0] # First element of model_output contains all token embeddings
    input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)


# Sentences we want sentence embeddings for
sentences = ['This is an example sentence', 'Each sentence is converted']

# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/paraphrase-multilingual-mpnet-base-v2')
model = AutoModel.from_pretrained('sentence-transformers/paraphrase-multilingual-mpnet-base-v2')

# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')

# Compute token embeddings
with torch.no_grad():
    model_output = model(**encoded_input)

# Perform pooling. In this case, mean pooling
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])

print("Sentence embeddings:")
print(sentence_embeddings)

Usage (Text Embeddings Inference (TEI))

Text Embeddings Inference (TEI) is a blazing fast inference solution for text embedding models.

  • CPU:
docker run -p 8080:80 -v hf_cache:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cpu-latest --model-id sentence-transformers/paraphrase-multilingual-mpnet-base-v2 --pooling mean --dtype float16
  • NVIDIA GPU:
docker run --gpus all -p 8080:80 -v hf_cache:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cuda-latest --model-id sentence-transformers/paraphrase-multilingual-mpnet-base-v2 --pooling mean --dtype float16

Send a request to /v1/embeddings to generate embeddings via the OpenAI Embeddings API:

curl http://localhost:8080/v1/embeddings \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
    "input": "This is an example sentence"
  }'

Or check the Text Embeddings Inference API specification instead.

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: XLMRobertaModel 
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
)

Citing & Authors

This model was trained by sentence-transformers.

If you find this model helpful, feel free to cite our publication Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks:

@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "http://arxiv.org/abs/1908.10084",
}

Model architecture

config.json
Architecture
XLMRobertaModel
Model type
xlm-roberta
Hidden size
768
Layers
12
Attention heads
12
FFN size
3,072
Vocab size
250,002
Context window
514

Files

28 items
  • 47dbcce8eeba

    72.4 MB

  • 385d92473c1b

    69.5 MB

  • bd82d2f7d89d

    69.1 MB

  • bbea29c389c5

    68.5 MB

  • a3442f932011

    68.4 MB

  • ac537c7f5e07

    67.7 MB

  • 07280c131916

    67.4 MB

  • e6c26d81d7ab

    66.8 MB

  • f54e357bfccc

    65.9 MB

  • 26784d84f0ec

    65.4 MB

  • 8260cb9b94c9

    65.3 MB

  • 422b2dc3f811

    64.8 MB

  • 2803a0b6dc53

    64.7 MB

  • 357d29e2c031

    64.6 MB

  • 79507c406f76

    64.2 MB

  • 368965d47f20

    56.0 MB

  • tokenizer.json

    2c3387be7655

    8.7 MB

  • sentencepiece.bpe.model

    cfc8146abe2a

    4.8 MB

  • model.safetensors

    c2b0dd6352c5

    41.4 KB

    safetensors

  • README.md

    a72f5bdf7a68

    5.5 KB

  • hippius-provenance.json

    6cc5aa2ab92c

    1.4 KB

  • config.json

    8b94b5c10efd

    723 B

  • tokenizer_config.json

    a312d5bef89e

    402 B

  • special_tokens_map.json

    378eb3bf733e

    239 B

  • modules.json

    8f4b264b8020

    229 B

  • 1_Pooling/config.json

    a37f83ada23e

    190 B

  • config_sentence_transformers.json

    b8c64b5cece0

    122 B

  • sentence_bert_config.json

    70f4448f3132

    53 B