Downloads · 30 days
4
3% of all-time downloads
khaangnguyeen/ruri-v3-310m-onnx
ruri-v3-310m-onnx is a feature extraction model from khaangnguyeen. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as apache-2.0.
This is the ONNX version of the embedding model cl-nagoya/ruri-v3-310m.
Downloads · 30 days
4
3% of all-time downloads
All-time downloads
115
Public
Repo size
1.3 GB
Likes
0
Public
Click a slice to open those files.
.onnx1.3 GB · 99%
From the Hugging Face model README
This is the ONNX version of the embedding model cl-nagoya/ruri-v3-310m.
| File | Size |
|---|---|
| config.json | 0.00 MB |
| model.onnx | 1200.70 MB |
| special_tokens_map.json | 0.00 MB |
| tokenizer.json | 6.41 MB |
| tokenizer.model | 1.75 MB |
| tokenizer_config.json | 0.00 MB |
from optimum.onnxruntime import ORTModelForFeatureExtraction
from transformers import AutoTokenizer
import torch
# Load model and tokenizer
model = ORTModelForFeatureExtraction.from_pretrained(
"khaangnguyeen/ruri-v3-310m-onnx",
provider="CPUExecutionProvider" # or "CUDAExecutionProvider" for GPU
)
tokenizer = AutoTokenizer.from_pretrained("khaangnguyeen/ruri-v3-310m-onnx")
# Encode text
texts = ["Example sentence", "Another example"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt")
# Get embeddings
with torch.no_grad():
outputs = model(**inputs)
embeddings = outputs.last_hidden_state.mean(dim=1) # Mean pooling
print(embeddings.shape) # (2, hidden_size)
import onnxruntime as ort
import numpy as np
from transformers import AutoTokenizer
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("khaangnguyeen/ruri-v3-310m-onnx")
# Create ONNX Runtime session
session = ort.InferenceSession("model.onnx")
# Prepare inputs
text = "Example sentence"
inputs = tokenizer(text, return_tensors="np", padding=True, truncation=True)
# Run inference
outputs = session.run(
None,
{
"input_ids": inputs["input_ids"],
"attention_mask": inputs["attention_mask"]
}
)
embeddings = outputs[0].mean(axis=1)
print(embeddings.shape)
ONNX Runtime provides:
CPU Benchmark (example):
Apache-2.0 (inherited from base model)
@misc{ruri-v3-onnx,
author = {khaangnguyeen},
title = {Ruri v3 310M ONNX},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{[https://huggingface.co/khaangnguyeen/ruri-v3-310m-onnx](https://huggingface.co/khaangnguyeen/ruri-v3-310m-onnx)}}
}