Downloads · 30 days
16
33% of all-time downloads
Teradata/ruri-v3-30m
ruri-v3-30m is a feature extraction model from Teradata. Use it when you need embeddings to search or compare text. It is set up for sentence-transformers. The card lists the license as apache-2.0.
Read the disclaimer below before using this model.
Downloads · 30 days
16
33% of all-time downloads
All-time downloads
48
Public
Repo size
246 MB
Likes
0
Public
Click a slice to open those files.
.onnx246 MB · 97%
From the Hugging Face model README
Read the disclaimer below before using this model.
This repository hosts an ONNX-converted version of the upstream
model cl-nagoya/ruri-v3-30m,
packaged for the Teradata Vantage mldb.ONNXEmbeddings BYOM
function. It is not the original PyTorch model -- only the
inference graph and tokenizer needed for in-database embedding
generation.
What's different from upstream:
sentence_embedding tensor. Pooling rule is
mean and the model expects
a query-time instruction prefix (see "Instruction prefix" below).| Upstream repo | cl-nagoya/ruri-v3-30m |
| Architecture | ModernBertModel (encoder) |
| Parameters | 36,705,536 |
| Output dimensions | 256 |
| Pooling | mean |
| Instruction prefix | yes |
| Max input tokens (advertised) | 8192 |
| Languages | 1 |
| License | apache-2.0 |
| ONNX opset | 14 |
| ONNX IR version | 8 (BYOM 6+ compatible) |
jaThis model was trained with a role-specific prefix scheme: the text
you encode must be prefixed according to what you are using the
embedding for. The prefix wording is not customisable -- the model
only understands these specific strings, and the trailing : (ASCII
colon + ASCII space) is part of the prefix.
| Prefix | Use it for |
|---|---|
| (empty string) | semantic similarity and general-purpose encoding |
トピック: | classification, clustering, and topical encoding |
検索クエリ: | retrieval -- the query side |
検索文書: | retrieval -- the document side |
The two sides of a retrieval pair take different prefixes. This
is the part most easily got wrong: prefixing both sides with the same
string, or prefixing only one side, degrades retrieval quality without
producing any error. Prefix your queries with
検索クエリ: and the passages you index
with 検索文書: .
The ONNX graph itself is prefix-agnostic -- the prefix is plain text that flows through the tokenizer. Downstream BYOM SQL is responsible for prepending it, typically with a CTE that concatenates the prefix onto each input row.
Worked example -- the same subject encoded on each side of a retrieval pair:
query: 検索クエリ: 瑠璃色はどんな色?
document: 検索文書: 瑠璃色(るりいろ)は、紫みを帯びた濃い青。
Example SQL (queries and documents prefixed separately, then embedded through the same model):
WITH prefixed_queries AS (
SELECT id,
'検索クエリ: ' || query_text AS txt
FROM my_query_table
),
prefixed_documents AS (
SELECT id,
'検索文書: ' || body_text AS txt
FROM my_document_table
)
SELECT *
FROM mldb.ONNXEmbeddings(
ON prefixed_queries
ON embeddings_models AS ModelTable DIMENSION
ON embeddings_tokenizers AS TokenizerTable DIMENSION
USING
Accumulate('id')
ModelOutputTensor('sentence_embedding')
) AS s;
See
cl-nagoya/ruri-v3-30m for the
canonical guidance.
This repository ships the following variants. The Size column is the on-disk size of the ONNX weight file in megabytes (MB, 10^6 bytes). Quality numbers may not generalize to your data; they come from a fixed sample of JMTEB retrieval (2 of 8 subsets: jagovfaqs_22k, nlp_journal_title_abs).
Those numbers were measured with inputs tokenized at a maximum sequence length of 512 tokens.
| Variant | Size (MB) | p50 cosine | R@1 | Δ R@1 vs fp32 |
|---|---|---|---|---|
fp32 | 147.1 | 1.000000 | 0.918 | — |
per_channel | 38.1 | 0.993101 | 0.911 | -0.007 |
ffn_skip | 60.8 | 0.999800 | 0.918 | +0.000 |
How to read the quality columns:
fp32 row the comparison is
against the upstream PyTorch model instead, so that row measures
export drift rather than quantization drift.fp32 row's, on the same
corpus at the same sequence length. Because every row is measured the
same way, the fp32 row is this model's unquantized ceiling, and this
column is the retrieval quality actually given up to quantization.
Read it when choosing between variants: two artifacts can post similar
absolute R@1 while one has given up several times as much against its
own ceiling, and only the delta shows that.Notes:
Requires Teradata Vantage with BYOM 6+ (mldb.ONNXEmbeddings).
import getpass
import teradataml as tdml
from huggingface_hub import hf_hub_download
repo_id = "Teradata/ruri-v3-30m"
model_id = "ruri-v3-30m" # arbitrary, used as the BYOM model_id
onnx_file = "onnx/model-per_channel.onnx"
# 1. Download the ONNX + tokenizer for the chosen variant.
hf_hub_download(repo_id=repo_id, filename=onnx_file, local_dir="./")
hf_hub_download(repo_id=repo_id, filename="tokenizer.json", local_dir="./")
# 2. Connect to Vantage.
tdml.create_context(
host=input("host: "),
username=input("user: "),
password=getpass.getpass("password: "),
)
# 3. Load model + tokenizer into BYOM tables (one-time per model_id).
tdml.save_byom(model_id=model_id, model_file=onnx_file,
table_name="embeddings_models")
tdml.save_byom(model_id=model_id, model_file="tokenizer.json",
table_name="embeddings_tokenizers")
Then call mldb.ONNXEmbeddings against an input table whose
txt column carries the strings to embed:
SELECT *
FROM mldb.ONNXEmbeddings(
ON (SELECT id, txt FROM your_input_table) AS InputTable
ON (SELECT model_id, model FROM embeddings_models
WHERE model_id = 'ruri-v3-30m') AS ModelTable DIMENSION
ON (SELECT model_id, tokenizer FROM embeddings_tokenizers
WHERE model_id = 'ruri-v3-30m') AS TokenizerTable DIMENSION
USING
Accumulate('id')
ModelOutputTensor('sentence_embedding')
OutputFormat('FLOAT32(256)')
OverwriteCachedModel('*')
) AS t
ORDER BY id;
Pooling rule mean is applied inside the converted
ONNX graph -- the output tensor named above already contains the
pooled, post-processed embedding vector. For instruction-prefix models, prepend
the recommended instruction text to each input txt before calling
ONNXEmbeddings; the prefix is plain text that the tokenizer handles
unchanged.
The original weights and training methodology belong to
the Ruri authors at Nagoya University. Please cite their work, not this
repository, in academic contexts. The canonical upstream model card
is at
cl-nagoya/ruri-v3-30m;
refer to it for benchmarks, training details, intended use, and
citation information.
cl-nagoya/ruri-v3-30m is itself derived from earlier models, and not every
model in that chain is under the same license as this one. The
license field in this repository's metadata can only carry a single
value (apache-2.0 -- the license of cl-nagoya/ruri-v3-30m), so the
full chain is stated here:
| Upstream model | License | Relationship |
|---|---|---|
cl-nagoya/ruri-v3-30m | apache-2.0 | the model converted here |
cl-nagoya/ruri-v3-pt-30m | apache-2.0 | direct base (Ruri v3 pretrained backbone) |
sbintuitions/modernbert-ja-30m | mit | ModernBERT-Ja base of the pretrained backbone |
Your use of this artifact is subject to the terms of every license in that chain. Check each upstream model card for its authoritative license text.
For ONNX-conversion or BYOM-compatibility issues specific to this Teradata-converted artifact, please open a Discussion on this model's Hugging Face page. Questions about the underlying model quality, training, or intended use should go to the upstream maintainer's model card.
DISCLAIMER: The content herein ("Content") is provided "AS IS" and is not covered by any Teradata Operations, Inc. and its affiliates ("Teradata") agreements. Its listing here does not constitute certification or endorsement by Teradata.
To the extent any of the Content contains or is related to any artificial intelligence ("AI") or other language learning models ("Models") that interoperate with the products and services of Teradata, by accessing, bringing, deploying or using such Models, you acknowledge and agree that you are solely responsible for ensuring compliance with all applicable laws, regulations, and restrictions governing the use, deployment, and distribution of AI technologies. This includes, but is not limited to, AI Diffusion Rules, European Union AI Act, AI-related laws and regulations, privacy laws, export controls, and financial or sector-specific regulations.
While Teradata may provide support, guidance, or assistance in the deployment or implementation of Models to interoperate with Teradata's products and/or services, you remain fully responsible for ensuring that your Models, data, and applications comply with all relevant legal and regulatory obligations. Our assistance does not constitute legal or regulatory approval, and Teradata disclaims any liability arising from non-compliance with applicable laws.
You must determine the suitability of the Models for any purpose. Given the probabilistic nature of machine learning and modeling, the use of the Models may in some situations result in incorrect output that does not accurately reflect the action generated. You should evaluate the accuracy of any output as appropriate for your use case, including by using human review of the output.