Views
No views yet
| File | Precision | Size | Use |
|---|---|---|---|
onnx/model.onnx | fp32 | 1.2 GB | reference / server (cos@256 = 1.000 vs PyTorch) |
onnx/model_quantized.onnx | int8 (q8) | 296 MB | what the browser loads (cos@256 ≈ 0.97) |
sentence_embedding directly — the trained Dense/Matryoshka
heads are baked into the graph. 768-native; truncate to 256 dims and
re-normalize (Matryoshka) to match the on-device lcsh.db. No prompt/prefix
is applied (the fine-tune is symmetric).1import { pipeline } from '@huggingface/transformers';
2const extractor = await pipeline('feature-extraction',
3 'kltng/embeddinggemma-300m-lcsh-onnx', { dtype: 'q8' });
4const out = await extractor(text, { pooling: 'none' }); // already sentence_embedding
5// take out[:256], L2-normalize, then cosine vs the lcsh.db vectors.kltng/lcsh-db-ft (an lcsh.db
re-embedded with this exact q8 model, so build-time and query-time vectors are
consistent).google/embeddinggemma-300m and distributed under the
Gemma Terms of Use. Use is subject to
Google's Gemma Prohibited Use Policy.