mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Send abort signal to koboldcpp server on abort.
Simply aborting on client side does not end generation of streaming tokens on the koboldcpp side, creating an awful user experience where starting a new generation does not work, and potentially causing segfaults in koboldcpp if another generation is started while the previous one is still processing.
This commit is contained in:
parent
99f32a0ee1
commit
0cf9d8895c
@ -26,6 +26,8 @@ const kai_settings = {
|
|||||||
single_line: false,
|
single_line: false,
|
||||||
use_stop_sequence: false,
|
use_stop_sequence: false,
|
||||||
streaming_kobold: false,
|
streaming_kobold: false,
|
||||||
|
can_use_streaming: false,
|
||||||
|
api_server: 'http://0.0.0.0:5000',
|
||||||
};
|
};
|
||||||
|
|
||||||
const MIN_STOP_SEQUENCE_VERSION = '1.2.2';
|
const MIN_STOP_SEQUENCE_VERSION = '1.2.2';
|
||||||
@ -62,10 +64,15 @@ function loadKoboldSettings(preset) {
|
|||||||
kai_settings.single_line = preset.single_line;
|
kai_settings.single_line = preset.single_line;
|
||||||
$('#single_line').prop('checked', kai_settings.single_line);
|
$('#single_line').prop('checked', kai_settings.single_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preset.hasOwnProperty('streaming_kobold')) {
|
if (preset.hasOwnProperty('streaming_kobold')) {
|
||||||
kai_settings.streaming_kobold = preset.streaming_kobold;
|
kai_settings.streaming_kobold = preset.streaming_kobold;
|
||||||
$('#streaming_kobold').prop('checked', kai_settings.streaming_kobold);
|
$('#streaming_kobold').prop('checked', kai_settings.streaming_kobold);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (preset.hasOwnProperty('api_server')) {
|
||||||
|
kai_settings.api_server = preset.api_server;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getKoboldGenerationData(finalPromt, this_settings, this_amount_gen, this_max_context, isImpersonate) {
|
function getKoboldGenerationData(finalPromt, this_settings, this_amount_gen, this_max_context, isImpersonate) {
|
||||||
@ -239,4 +246,12 @@ $(document).ready(function () {
|
|||||||
kai_settings.streaming_kobold = value;
|
kai_settings.streaming_kobold = value;
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#mes_stop').on("click", function () {
|
||||||
|
if (kai_settings.streaming_kobold && kai_settings.can_use_streaming) {
|
||||||
|
fetch(`${kai_settings.api_server}/extra/abort`, {
|
||||||
|
method: 'POST'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user