Instructions to use kltng/embeddinggemma-300m-lcsh-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use kltng/embeddinggemma-300m-lcsh-ONNX with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('feature-extraction', 'kltng/embeddinggemma-300m-lcsh-ONNX'); - sentence-transformers
How to use kltng/embeddinggemma-300m-lcsh-ONNX with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("kltng/embeddinggemma-300m-lcsh-ONNX") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
embeddinggemma-300m-lcsh β ONNX (transformers.js)
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.
Files
| 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).
Usage (transformers.js)
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).
License
Derived from google/embeddinggemma-300m and distributed under the
Gemma Terms of Use. Use is subject to
Google's Gemma Prohibited Use Policy.
- Downloads last month
- 25
Model tree for kltng/embeddinggemma-300m-lcsh-ONNX
Base model
google/embeddinggemma-300m