Add `search_query: ` prefix to transformers.js sample code
#11
by
Xenova
HF staff
- opened
README.md
CHANGED
@@ -2724,7 +2724,7 @@ const extractor = await pipeline('feature-extraction', 'nomic-ai/nomic-embed-tex
|
|
2724 |
});
|
2725 |
|
2726 |
// Compute sentence embeddings
|
2727 |
-
const texts = ['What is TSNE?', 'Who is Laurens van der Maaten?'];
|
2728 |
const embeddings = await extractor(texts, { pooling: 'mean', normalize: true });
|
2729 |
console.log(embeddings);
|
2730 |
```
|
|
|
2724 |
});
|
2725 |
|
2726 |
// Compute sentence embeddings
|
2727 |
+
const texts = ['search_query: What is TSNE?', 'search_query: Who is Laurens van der Maaten?'];
|
2728 |
const embeddings = await extractor(texts, { pooling: 'mean', normalize: true });
|
2729 |
console.log(embeddings);
|
2730 |
```
|