Add proper processing of streaming aborting

This commit is contained in:
SillyLossy
2023-04-21 20:29:18 +03:00
parent 9af7c63d9c
commit f25ecbd95c
6 changed files with 62 additions and 10 deletions

View File

@ -147,7 +147,7 @@ function setSettingByName(i, value, trigger) {
}
}
async function generateTextGenWithStreaming(generate_data) {
async function generateTextGenWithStreaming(generate_data, signal) {
const response = await fetch('/generate_textgenerationwebui', {
headers: {
'X-CSRF-Token': token,
@ -157,6 +157,7 @@ async function generateTextGenWithStreaming(generate_data) {
},
body: JSON.stringify(generate_data),
method: 'POST',
signal: signal,
});
return async function* streamData() {