diff --git a/public/script.js b/public/script.js index be58c5922..cf6b4ebd9 100644 --- a/public/script.js +++ b/public/script.js @@ -5020,6 +5020,10 @@ async function sendGenerationRequest(type, data) { * @returns {Promise} Streaming generator */ async function sendStreamingRequest(type, data) { + if (abortController?.signal?.aborted) { + throw new Error('Generation was aborted.'); + } + switch (main_api) { case 'openai': return await sendOpenAIRequest(type, data.prompt, streamingProcessor.abortController.signal);