Add new SentenceTransformer models with an onnx backend

#11
by tomaarsen HF Staff - opened

Hello!

The models from this PR have been generated with Sentence Transformers, see export_dynamic_quantized_onnx_model, export_optimized_onnx_model.

Tip

Consider testing this pull request before merging by loading the model from this PR with the revision argument:

from sentence_transformers import SentenceTransformer

model = SentenceTransformer(
    "intfloat/multilingual-e5-small",
    revision=f"refs/pr/11",
    backend="onnx",
    model_kwargs={
        "file_name": "model_O3.onnx",
    }
)

# Verify that everything works as expected
embeddings = model.encode(["The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium."])
print(embeddings.shape)

similarities = model.similarity(embeddings, embeddings)
print(similarities)
  • Tom Aarsen
tomaarsen changed pull request status to closed

Sign up or log in to comment