Downloads · 30 days
11
5% of all-time downloads
michael-sigamani/nomic-embed-text-onnx
nomic-embed-text-onnx is a sentence similarity model from michael-sigamani. Use it when you need a score for how close two texts are. The card lists the license as apache-2.0.
Tags: text-embedding onnx nomic-embed-text sentence-transformers
Downloads · 30 days
11
5% of all-time downloads
All-time downloads
204
Public
Repo size
1.1 GB
Likes
0
Public
Click a slice to open those files.
.onnx1.1 GB · 100%
From the Hugging Face model README
Tags: text-embedding onnx nomic-embed-text sentence-transformers
model.onnxThis model outputs:
[batch_size, seq_len, hidden_size])[batch_size, hidden_size])Nomic Embed Text V1 is a BERT‐style encoder trained to generate high-quality dense representations of text. It is suitable for:
The ONNX export ensures compatibility with inference engines like ONNX Runtime and NVIDIA Triton Inference Server.
pip install onnxruntime transformers numpy
import onnxruntime as ort
session = ort.InferenceSession("model.onnx")
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("nomic-ai/nomic-embed-text-v1")
inputs = tokenizer(
["Hello world", "Another sentence"],
padding=True,
truncation=True,
return_tensors="np"
)
outputs = session.run(
["token_embeddings", "sentence_embedding"],
{
"input_ids": inputs["input_ids"],
"attention_mask": inputs["attention_mask"]
}
)
token_embeddings, sentence_embeddings = outputs
Place your model files under:
models/ └── nomic_embeddings/ └── 1/ ├── model.onnx ├── config.pbtxt └── (tokenizer files…)
Create a config.pbtxt file that looks something like this:
name: "nomic_embeddings"
backend: "onnxruntime"
max_batch_size: 8
input [
{
name: "input_ids"
data_type: TYPE_INT32
dims: [-1]
},
{
name: "attention_mask"
data_type: TYPE_INT32
dims: [-1]
}
]
output [
{
name: "token_embeddings"
data_type: TYPE_FP32
dims: [-1, 768]
},
{
name: "sentence_embedding"
data_type: TYPE_FP32
dims: [-1, 768]
}
]
instance_group [
{
kind: KIND_GPU
count: 1
}
]
Start Triton:
tritonserver \
--model-repository=/path/to/models \
--model-control-mode=explicit \
--load-model=nomic_embeddings