File size: 551 Bytes
897662d
67a897e
 
897662d
 
 
 
 
 
 
 
 
 
 
 
67a897e
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { pipeline } from '@xenova/transformers';

async function run() {
    // Load the pipeline for feature extraction (embeddings)
    const extractor = await pipeline(
        'feature-extraction', 
        'laituanmanh32/vietnamese-embedding-onnx',
        { 
            quantized: false, // Disable quantization (if using full-precision ONNX)
        }
    );

    // Generate embeddings for Vietnamese text
    const output = await extractor('Mô hình thử nghiệm', { pooling: 'mean' });
    console.log(output);
}

run();