Downloads · 30 days
13
15% of all-time downloads
szdr/ruri-v3-reranker-310m-onnx
ruri-v3-reranker-310m-onnx is a text ranking model from szdr. Use it for the text ranking task on the model card, and read the license before you ship it in a product. It is set up for sentence-transformers. The card lists the license as apache-2.0.
This is an unofficial, community-produced ONNX conversion of cl-nagoya/ruri-v3-reranker-310m.
Downloads · 30 days
13
15% of all-time downloads
All-time downloads
86
Public
Repo size
2.5 GB
Likes
0
Public
Click a slice to open those files.
.onnx1.3 GB · 50%
From the Hugging Face model README
This is an unofficial, community-produced ONNX conversion of
cl-nagoya/ruri-v3-reranker-310m.
This repository is not published, reviewed, or endorsed by the original authors. All credit for the model architecture, training data, and weights belongs to the original authors (Hayato Tsukagoshi, Ryohei Sasano, and the cl-nagoya lab). Please refer to the original model card for the full description, intended use, and evaluation results (e.g. JQaRA).
torch.onnx.export
(legacy TorchScript-based exporter, opset 14, attn_implementation="eager"
to avoid FlashAttention-specific control flow).import numpy as np
import onnxruntime as ort
from transformers import AutoTokenizer
from huggingface_hub import hf_hub_download
repo_id = "szdr/ruri-v3-reranker-310m-onnx"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
onnx_path = hf_hub_download(repo_id, "model.onnx")
session = ort.InferenceSession(onnx_path)
inputs = tokenizer(["query"], ["document"], return_tensors="np", padding=True, truncation=True)
logits = session.run(None, {
"input_ids": inputs["input_ids"].astype(np.int64),
"attention_mask": inputs["attention_mask"].astype(np.int64),
})[0]
score = 1 / (1 + np.exp(-logits))
Apache License 2.0, identical to the original model. See LICENSE.
Please cite the original work (not this conversion):
@misc{Ruri,
title={Ruri: Japanese General Text Embeddings},
author={Hayato Tsukagoshi and Ryohei Sasano},
year={2024},
eprint={2409.07737},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2409.07737},
}