File size: 942 Bytes
6b2f334 3a60d6b 93f4405 6b2f334 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
---
license: mit
base_model:
- sentence-transformers/msmarco-distilbert-cos-v5
---
# Usage using Transformer.js for feature extraction
```
import { env, pipeline } from "@xenova/transformers";
env.allowLocalModels = false;
const extractor = await pipeline(
"feature-extraction",
"Fuzail22/onnx-msmarco-distilbert-cos-v5",
{
quantized: false
}
);
const extract = async (text: string) => {
const output = await extractor(text, {
pooling: "mean",
normalize: true
});
console.log("extraction output:", output);
};
extact("Open Source is great!")
```
> This is Onnx converted version of the original model
> The Input Sequence length is 512
Converted Using [Xenova](https://github.com/xenova/transformers.js/blob/main/scripts/convert.py)
Link to original Model [sentence-transformers/msmarco-distilbert-cos-v5](https://huggingface.co/sentence-transformers/msmarco-distilbert-cos-v5/blob/main/README.md) |