ONNX Model Zoo

vamsibanda/sbert-all-MiniLM-L12-with-pooler

By vamsibanda · ↓ 3 · ♥ 0 · Updated 2022-09-13

What's in this repo

This page lists the files in vamsibanda/sbert-all-MiniLM-L12-with-pooler, including model.onnx.

  • 1 ONNX models (.onnx files)
  • 9 files, including 5 .json, 1 .md, 1 .onnx, 1 .txt
  • Last updated 2022-09-13

ONNX files

File Size Download
model.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

ONNX convert all-MiniLM-L12-v2

Conversion of sentence-transformers/all-MiniLM-L12-v2

This is a sentence-transformers ONNX model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. This custom model takes last_hidden_state and pooler_output whereas the sentence-transformers exported with default ONNX config only contains last_hidden_state as output.

Usage (HuggingFace Optimum)

Using this model becomes easy when you have optimum installed:

python -m pip install optimum

Then you can use the model like this:

from optimum.onnxruntime.modeling_ort import ORTModelForCustomTasks

model = ORTModelForCustomTasks.from_pretrained("vamsibanda/sbert-all-MiniLM-L12-with-pooler")
tokenizer = AutoTokenizer.from_pretrained("vamsibanda/sbert-all-MiniLM-L12-with-pooler")
inputs = tokenizer("I love burritos!", return_tensors="pt")
pred = model(**inputs)
embedding = pred['pooler_output']

Model info

sentence-similarity sentence-transformers
sentence-transformers onnx bert feature-extraction sentence-similarity transformers en license:apache-2.0 text-embeddings-inference endpoints_compatible region:us
↓ 3 ♥ 0

Created: 2022-07-23

Updated: 2022-09-13

View on Hugging Face

Files (9)

.gitattributes
1_Pooling/config.json
README.md
config.json
model.onnx ONNX
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.txt

Related models