Instructions to use tooape/granite-embedding-97m-multilingual-r2-GBQ4-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use tooape/granite-embedding-97m-multilingual-r2-GBQ4-ONNX with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('feature-extraction', 'tooape/granite-embedding-97m-multilingual-r2-GBQ4-ONNX');
granite-embedding-97m-multilingual-r2 β GBQ-int4 ONNX (transformers.js)
ONNX export of ibm-granite/granite-embedding-97m-multilingual-r2 for transformers.js / onnxruntime-web, sized for in-browser retrieval (61.2 MB):
- Body: MatMulNBits q4 (block 32, symmetric, accuracy_level 4)
- Embedding table (180k Γ 384, 71% of params):
GatherBlockQuantizedint4,quant_axes=("Gather", 1)β runs natively on the WebGPU EP (ORT β₯ 1.23); plain int8 Gather has no WebGPU kernel and falls back to WASM. - Exported via optimum (feature-extraction) +
MatMulNBitsQuantizerwithop_types_to_quantize=("MatMul", "Gather"), opset 21.
Outputs token_embeddings / sentence_embedding; use pooling: 'cls',
normalize: true (the model is CLS-pooled, symmetric β no query/doc prompts).
Quantization relevance gate (vs fp32, graded nDCG@10 on private retrieval corpora + Belebele): English Β±0.003; Belebele dense β0.005 (en) β¦ β0.021 (ko), multilingual advantage over English-only siblings fully intact.
import { pipeline } from '@huggingface/transformers';
const extractor = await pipeline('feature-extraction',
'tooape/granite-embedding-97m-multilingual-r2-GBQ4-ONNX',
{ device: 'webgpu', dtype: 'q4' });
const v = await extractor('search query', { pooling: 'cls', normalize: true });
- Downloads last month
- 645