Closed
Description
I was just playing around with the model distiluse-base-multilingual-cased-v2 and noticed that your onnx versions both (quantized and normal) produce embeddings with 768-dimensional vectors instead of 512.
Example:
index.html
<!DOCTYPE html>
<html>
<head>
<title>Transformers.js Example</title>
</head>
<body>
<h1>Transformers.js Example</h1>
<script type="module" src="main.js"></script>
</body>
</html>
main.js
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/[email protected]';
async function allocatePipeline() {
let pipe = await pipeline("feature-extraction",
"Xenova/distiluse-base-multilingual-cased-v2");
let out = await await pipe("test", { pooling: 'mean', normalize: true });
console.log(out);
}
allocatePipeline();
That gives me
Proxy(s) {dims: Array(2), type: 'float32', data: Float32Array(768), size: 768}
However, the model page states
This is a sentence-transformers model: It maps sentences & paragraphs to a 512 dimensional dense vector space and can be used for tasks like clustering or semantic search.
Also, I used the Python package
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('sentence-transformers/distiluse-base-multilingual-cased-v2')
model.encode("test")
which gives me a correct 512-dimensional embedding.
Am I missing some option here or overseeing the obvious?