Fix manual vectorization of files

This commit is contained in:
Cohee 2024-04-19 18:43:35 +03:00
parent 19ea1ee56c
commit a3f6ce52e4
1 changed files with 7 additions and 0 deletions

View File

@ -893,6 +893,13 @@ async function onVectorizeAllFilesClick() {
for (const file of allFiles) {
const text = await getFileAttachment(file.url);
const collectionId = getFileCollectionId(file.url);
const hashes = await getSavedHashes(collectionId);
if (hashes.length) {
console.log(`Vectors: File ${file.name} is already vectorized`);
continue;
}
await vectorizeFile(text, file.name, collectionId, settings.chunk_size);
}