whitphx/test-transformersjs-jina-embeddings-v2-small-en
By whitphx · ↓ 8 · ♥ 0 · Updated 2025-06-17
What's in this repo
This page lists the files in whitphx/test-transformersjs-jina-embeddings-v2-small-en, including model.onnx, model_fp16.onnx, model_quantized.onnx.
- 3 ONNX models (.onnx files)
- 11 files, including 5 .json, 3 .onnx, 1 .md, 1 .txt
- Last updated 2025-06-17
ONNX files
| File | Size | Download |
|---|---|---|
| onnx/model.onnx | — | Download |
| onnx/model_fp16.onnx | — | Download |
| onnx/model_quantized.onnx | — | Download |
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
https://huggingface.co/jinaai/jina-embeddings-v2-small-en with ONNX weights to be compatible with Transformers.js.
Usage with 🤗 Transformers.js
// npm i @xenova/transformers
import { pipeline, cos_sim } from '@xenova/transformers';
// Create feature extraction pipeline
const extractor = await pipeline('feature-extraction', 'Xenova/jina-embeddings-v2-small-en',
{ quantized: false } // Comment out this line to use the quantized version
);
// Generate embeddings
const output = await extractor(
['How is the weather today?', 'What is the current weather like today?'],
{ pooling: 'mean' }
);
// Compute cosine similarity
console.log(cos_sim(output[0].data, output[1].data)); // 0.9399812684139274 (unquantized) vs. 0.9341121503699659 (quantized)
Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using 🤗 Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).
Model info
Created: 2025-06-17
Updated: 2025-06-17
View on Hugging Face