Skip to content

Commit

Permalink
Include last chunk in websearch context (#912)
Browse files Browse the repository at this point in the history
Fix bug where last chunk was dropped in websearch
  • Loading branch information
nsarrazin committed Mar 7, 2024
1 parent bcfa394 commit 8e839b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/server/sentenceSimilarity.ts
Expand Up @@ -22,7 +22,7 @@ export async function findSimilarSentences(
const output = await embeddingEndpoint({ inputs });

const queryEmbedding: Embedding = output[0];
const sentencesEmbeddings: Embedding[] = output.slice(1, inputs.length - 1);
const sentencesEmbeddings: Embedding[] = output.slice(1);

const distancesFromQuery: { distance: number; index: number }[] = [...sentencesEmbeddings].map(
(sentenceEmbedding: Embedding, index: number) => {
Expand Down

0 comments on commit 8e839b8

Please sign in to comment.