This commit is contained in:
Manav Rathi
2024-06-29 11:32:21 +05:30
parent 66cb95e32c
commit bb37630bae

View File

@@ -126,9 +126,9 @@ const pullEmbeddings = async (
/* eslint-disable no-constant-condition */
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while (true) {
let c = 0;
const remoteEmbeddings = await getEmbeddingsDiff(model, sinceTime);
if (remoteEmbeddings.length == 0) break;
let count = 0;
for (const remoteEmbedding of remoteEmbeddings) {
sinceTime = Math.max(sinceTime, remoteEmbedding.updatedAt);
try {
@@ -141,13 +141,13 @@ const pullEmbeddings = async (
file.key,
),
);
c++;
count++;
} catch (e) {
log.warn(`Ignoring unparseable ${model} embedding`, e);
}
}
saveEmbeddingSyncTime(sinceTime, model);
log.info(`Fetched ${c} ${model} embeddings`);
log.info(`Fetched ${count} ${model} embeddings`);
}
};