mmlw-retrieval-roberta-large-v2 — Core ML (float16)

Core ML conversion of sdadas/mmlw-retrieval-roberta-large-v2 by Sławomir Dadas (OPI PIB), for on-device retrieval (search in recordings and documents) in the AudioTranscriber app (iPhone and Mac; Neural Engine / GPU).

Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms.

The original model is a derivative subject to the Gemma Terms of Use (training data prepared with a Gemma-based model), so this conversion is distributed under the same terms. Use of this model must comply with the Gemma Terms of Use (copy: GEMMA_TERMS_OF_USE.md) and the Gemma Prohibited Use Policy (copy: GEMMA_PROHIBITED_USE_POLICY.md), which are incorporated by reference. See also NOTICE.

Files

File Contents
model.mlmodelc/ compiled Core ML model (mlprogram, float16 weights)
meta.json dimensions, max tokens, input shapes, query prefix, special token ids
tokenizer.json, tokenizer_config.json, special_tokens_map.json, config.json original tokenizer and config
reference.json reference token ids and PyTorch (fp32) embeddings for 5 test sentences (conversion check)

Usage

  • Inputs: input_ids and attention_mask (int32, shape [1, n], n ∈ 512), right-padded with the pad token id 1; maximum 512 tokens.
  • Output: embedding — float32 [1, 1024], already L2-normalized (cosine = dot product).
  • Queries must be prefixed with [query]: (as in the original model card); passages are encoded without a prefix.

Changes made (conversion)

  • PyTorch → Core ML mlprogram (coremltools), float16 compute precision, enumerated input shapes;
  • CLS pooling and L2 normalization moved into the graph (same as the original Sentence-Transformers configuration);
  • attention mask computed explicitly (additive 4D mask), encoder layers unchanged;
  • no fine-tuning, no change of weights other than the float16 format.

Conversion script: AudioTranscriber tools/rag_coreml_convert.py (source revision of the original: 13701958e518c47b1f3f91b4d2cdd5afb3eb9331). Quality of the original model (benchmark by the app authors, nDCG@10): PolQA (PL) 0.771, SciFact-PL 0.789, SciFact (EN) 0.786.

Attribution

  • Original model: SÅ‚awomir Dadas, National Information Processing Institute (OPI PIB) — sdadas/mmlw-retrieval-roberta-large-v2.
  • Gemma is a trademark of Google LLC. This repository is not affiliated with or endorsed by Google or OPI PIB.
Downloads last month
39
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for PiterQ/mmlw-retrieval-roberta-large-v2-CoreML

Finetuned
(1)
this model