Views
No views yet
npm install @huggingface/transformers1import { pipeline } from '@huggingface/transformers';
2
3// Loads the model (automatically selects the quantized version)
4const embedder = await pipeline(
5 'feature-extraction',
6 'lebchen/norbert3-base-onnx',
7 { device: 'auto' }
8);
9
10const sentences = [
11 "Dette er en setning på norsk.",
12 "Norbert er en språkmodell fra UiO."
13];
14
15// Norbert generally benefits from mean pooling for sentence representations
16const output = await embedder(sentences, { pooling: 'mean', normalize: true });
17
18console.log(output.tolist());1const embedder = await pipeline(
2 'feature-extraction',
3 'lebchen/norbert3-base-onnx',
4 {
5 device: 'auto',
6 quantized: false
7 }
8);