Skip to content

Commit

Permalink
docs: update README.md with query and passage embeddings
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 authored Sep 19, 2023
1 parent c313fbb commit 129aca3
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,26 @@ let documents = [
const embeddings = embeddingModel.embed(documents, 2); //Optional batch size. Defaults to 256

for await (const batch of embeddings) {
// batch is list of Float32 embeddings
// batch is list of Float32 embeddings(number[][])
console.log(batch);
}

```

#### Supports passage and query embeddings for more accurate results
```ts
const embeddings = embeddingModel.passageEmbed(listOfLongTexts, 2); //Optional batch size. Defaults to 256

for await (const batch of embeddings) {
// batch is list of Float32 passage embeddings(number[][])
console.log(batch);
}

const queryEmbeddings: number[] = await embeddingModel.queryEmbed(userQuery);
console.log(queryEmbeddings)

```

## 🚒 Under the hood

### Why fast?
Expand Down

0 comments on commit 129aca3

Please sign in to comment.