mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-15 11:30:09 +01:00
Fix vectorize all with no chat selected
This commit is contained in:
parent
17367f2b17
commit
c9d8d7ba64
@ -27,6 +27,12 @@ async function onVectorizeAllClick() {
|
||||
}
|
||||
|
||||
const chatId = getCurrentChatId();
|
||||
|
||||
if (!chatId) {
|
||||
toastr.info('No chat selected', 'Vectorization aborted');
|
||||
return;
|
||||
}
|
||||
|
||||
const batchSize = 5;
|
||||
const elapsedLog = [];
|
||||
let finished = false;
|
||||
@ -89,7 +95,7 @@ async function synchronizeChat(batchSize = 5) {
|
||||
|
||||
if (!chatId || !Array.isArray(context.chat)) {
|
||||
console.debug('Vectors: No chat selected');
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
|
||||
const hashedMessages = context.chat.filter(x => !x.is_system).map(x => ({ text: String(x.mes), hash: getStringHash(x.mes) }));
|
||||
|
Loading…
x
Reference in New Issue
Block a user