mandarjoshi/trivia_qa
Viewer • Updated • 848k • 86.2k • 192
How to use nixiesearch/multilingual-e5-large-onnx with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("nixiesearch/multilingual-e5-large-onnx")
sentences = [
"The weather is lovely today.",
"It's so sunny outside!",
"He drove to the stadium."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]This is a sentence-transformers model: It maps sentences & paragraphs to a N dimensional dense vector space and can be used for tasks like clustering or semantic search.
The model conversion was made with onnx-convert tool with the following parameters:
python convert.sh --model_id intfloat/multilingual-e5-large --quantize QInt8 --optimize 0
There are two versions of model available:
model.onnx - Float32 version, with optimize=0model_opt0_QInt8.onnx - QInt8 quantized version, with optimize=0Compared to the base/small versions of the model, this one is not optimized due to a bug in ONNX runtime: https://github.com/microsoft/onnxruntime/issues/15563
Apache 2.0