Add awaits to event emissions

This commit is contained in:
Cohee
2025-02-08 19:13:05 +02:00
parent 5886bb6b3a
commit d5959a4681
4 changed files with 10 additions and 10 deletions

View File

@@ -1221,7 +1221,7 @@ function replaceMacrosInList(str) {
}
}
export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, isContinue, cfgValues, type) {
export async function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, isContinue, cfgValues, type) {
const canMultiSwipe = !isContinue && !isImpersonate && type !== 'quiet';
const dynatemp = isDynamicTemperatureSupported();
const { banned_tokens, banned_strings } = getCustomTokenBans();
@@ -1449,7 +1449,7 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
}
}
eventSource.emitAndWait(event_types.TEXT_COMPLETION_SETTINGS_READY, params);
await eventSource.emit(event_types.TEXT_COMPLETION_SETTINGS_READY, params);
// Grammar conflicts with with json_schema
if (settings.type === LLAMACPP) {