mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix manual vectorization of files
This commit is contained in:
@@ -893,6 +893,13 @@ async function onVectorizeAllFilesClick() {
|
|||||||
for (const file of allFiles) {
|
for (const file of allFiles) {
|
||||||
const text = await getFileAttachment(file.url);
|
const text = await getFileAttachment(file.url);
|
||||||
const collectionId = getFileCollectionId(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);
|
await vectorizeFile(text, file.name, collectionId, settings.chunk_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user