Emit GENERATION_STARTED after processing commands

This commit is contained in:
Cohee 2024-09-17 13:55:10 +00:00
parent 0207794a2b
commit 8546f498bf
1 changed files with 2 additions and 1 deletions

View File

@ -3335,7 +3335,6 @@ function removeLastMessage() {
*/
export async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage, quietName } = {}, dryRun = false) {
console.log('Generate entered');
await eventSource.emit(event_types.GENERATION_STARTED, type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage }, dryRun);
setGenerationProgress(0);
generation_started = new Date();
@ -3358,6 +3357,8 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
}
}
await eventSource.emit(event_types.GENERATION_STARTED, type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage }, dryRun);
if (main_api == 'kobold' && kai_settings.streaming_kobold && !kai_flags.can_use_streaming) {
toastr.error('Streaming is enabled, but the version of Kobold used does not support token streaming.', undefined, { timeOut: 10000, preventDuplicates: true });
unblockGeneration(type);