Downloads · 30 days
5
11% of all-time downloads
kltng/embeddinggemma-300m-lcsh-ONNX
embeddinggemma-300m-lcsh-ONNX is a feature extraction model from kltng. Use it when you need embeddings to search or compare text. It is set up for transformers.js. The card lists the license as gemma.
ONNX export of the LCSH-fine-tuned EmbeddingGemma-300M (LoRA + Matryoshka, merged to a standalone backbone), packaged for in-browser / on-device use via transformers.js and ONNX Runtime Web. This is the embedder behin…
Downloads · 30 days
5
11% of all-time downloads
All-time downloads
46
Public
Repo size
3.1 GB
Likes
0
Public
Click a slice to open those files.
.onnx1.5 GB · 98%
From the Hugging Face model README
ONNX export of the LCSH-fine-tuned EmbeddingGemma-300M (LoRA + Matryoshka, merged to a standalone backbone), packaged for in-browser / on-device use via transformers.js and ONNX Runtime Web. This is the embedder behind the LCSHBench retrieval leaderboard ("EmbeddingGemma-300M, fine-tuned"), exported for a Chrome extension.
| 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) |
The model outputs 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).
import { pipeline } from '@huggingface/transformers';
const extractor = await pipeline('feature-extraction',
'kltng/embeddinggemma-300m-lcsh-onnx', { dtype: 'q8' });
const out = await extractor(text, { pooling: 'none' }); // already sentence_embedding
// take out[:256], L2-normalize, then cosine vs the lcsh.db vectors.
Pair with the companion vector store kltng/lcsh-db-ft (an lcsh.db
re-embedded with this exact q8 model, so build-time and query-time vectors are
consistent).
Derived from google/embeddinggemma-300m and distributed under the
Gemma Terms of Use. Use is subject to
Google's Gemma Prohibited Use Policy.