Skip to content

Commit a54fe7f

Browse files
committed
Improved examples [skip ci]
1 parent 94c2088 commit a54fe7f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

examples/sparse-search/example.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const input = [
4747
'The cat is purring',
4848
'The bear is growling'
4949
];
50-
5150
const embeddings = await embed(input);
5251
for (let [i, content] of input.entries()) {
5352
await client.query('INSERT INTO documents (content, embedding) VALUES ($1, $2)', [content, new SparseVector(embeddings[i], 30522)]);

examples/transformers/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ await pgvector.registerTypes(client);
1111
await client.query('DROP TABLE IF EXISTS documents');
1212
await client.query('CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding vector(384))');
1313

14-
const extractor = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2', {dtype: 'fp32'});
14+
const extractor = await pipeline('feature-extraction', 'Xenova/multi-qa-MiniLM-L6-cos-v1', {dtype: 'fp32'});
1515

1616
async function embed(input) {
1717
const output = await extractor(input, {pooling: 'mean', normalize: true});

0 commit comments

Comments
 (0)