Downloads · 30 days
8
6% of all-time downloads
vamsibanda/sbert-all-MiniLM-L12-with-pooler
sbert-all-MiniLM-L12-with-pooler is a sentence similarity model from vamsibanda. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as apache-2.0.
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 lasthiddenstate…
Downloads · 30 days
8
6% of all-time downloads
All-time downloads
136
Public
Repo size
267 MB
Likes
0
Public
Click a slice to open those files.
.onnx134 MB · 99%
From the Hugging Face model README
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.
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']