Spaces:
Build error
Build error
Include last chunk in websearch context (#912)
Browse filesFix bug where last chunk was dropped in websearch
src/lib/server/sentenceSimilarity.ts
CHANGED
@@ -22,7 +22,7 @@ export async function findSimilarSentences(
|
|
22 |
const output = await embeddingEndpoint({ inputs });
|
23 |
|
24 |
const queryEmbedding: Embedding = output[0];
|
25 |
-
const sentencesEmbeddings: Embedding[] = output.slice(1
|
26 |
|
27 |
const distancesFromQuery: { distance: number; index: number }[] = [...sentencesEmbeddings].map(
|
28 |
(sentenceEmbedding: Embedding, index: number) => {
|
|
|
22 |
const output = await embeddingEndpoint({ inputs });
|
23 |
|
24 |
const queryEmbedding: Embedding = output[0];
|
25 |
+
const sentencesEmbeddings: Embedding[] = output.slice(1);
|
26 |
|
27 |
const distancesFromQuery: { distance: number; index: number }[] = [...sentencesEmbeddings].map(
|
28 |
(sentenceEmbedding: Embedding, index: number) => {
|