ruri-v3-70m — COREML

日本語版はこちら (README.ja.md)

Japanese retrieval/semantic embeddings from the original Ruri-v3-70m checkpoint. Mask-aware mean pooling and L2 normalization are included. Retrieval inputs use the original prefixes 検索クエリ: and 検索文書: .

Converted directly from cl-nagoya/ruri-v3-70m at revision 07a8b0aba47d29d2ca21f89b915c1efe2c23d1cc. No new fine-tuning or replacement checkpoint. F32 baseline, not 4-bit quantization. Attribution: original checkpoint authors; format conversion by masahiroid.

Runtime and shapes

Core ML ML Program (*.mlpackage), F32 computation. Export target: macOS 14/iOS 17; inference was validated on macOS 27.2. iPhone performance has not been measured.

All exported components use fixed shapes and batch size 1:

  • text: {"input_ids": [1, 128], "attention_mask": [1, 128]}

Text is padded/truncated to 128 tokens. The source checkpoint supports longer contexts, but these exports do not expose those longer lengths. Included helpers handle tokenization and shape conversion.

Usage

Install the tested backend and preprocessing dependencies in an appropriate Apple Silicon environment:

pip install coremltools==9.0 numpy huggingface_hub transformers==4.57.3
from huggingface_hub import snapshot_download
import sys, numpy as np
path = snapshot_download("masahiroid/ruri-v3-70m-coreml")
sys.path.insert(0, path)
from inference import ConvertedModel
model = ConvertedModel(path)
embedding = model.text("検索クエリ: 日本の首都はどこですか?")
print(embedding.shape)  # (1, 384)

Validation

Numerically compared with the original PyTorch checkpoint: maximum absolute output difference 2.1792948e-07, minimum cosine similarity 0.999999999999. Per-case results and input shapes are in validation.json; deterministic input tensors and reference outputs are in *_validation_vectors.npz.

Tests include Japanese retrieval prefixes, Japanese text, English and empty input. No claim of improved task quality, robustness or device speed is made.

Reproduction and license

provenance.json pins the exact source checkpoint. prepare.py, common.py, build.py and sources.json are included for reproduction; arrange source snapshots under sources/<model-name>/. Tested conversion environment: PyTorch 2.14.1, Transformers 4.57.3, NumPy 1.26.4 and coremltools 9.0; MLX 0.32.4; Core AI conversion uses a separate Python 3.14 environment. Model data is saved without pickle checkpoints. Review included Python before executing it.

Original weights remain Apache-2.0, as declared by the source model card (LICENSE). Runtime/converter additions: MIT (CODE_LICENSE).

Converted formats

Downloads last month
45
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for masahiroid/ruri-v3-70m-coreml

Quantized
(10)
this model