mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix ooba tokenization via API. Fix requiring streaming URL to generate
This commit is contained in:
@ -869,15 +869,7 @@ async function getStatus() {
|
||||
|
||||
const url = main_api == "textgenerationwebui" ? '/api/textgenerationwebui/status' : '/getstatus';
|
||||
|
||||
let endpoint = api_server;
|
||||
|
||||
if (main_api == "textgenerationwebui") {
|
||||
endpoint = api_server_textgenerationwebui;
|
||||
}
|
||||
|
||||
if (main_api == "textgenerationwebui" && isMancer()) {
|
||||
endpoint = MANCER_SERVER;
|
||||
}
|
||||
let endpoint = getAPIServerUrl();
|
||||
|
||||
if (!endpoint) {
|
||||
console.warn("No endpoint for status check");
|
||||
@ -946,6 +938,22 @@ export function resultCheckStatus() {
|
||||
stopStatusLoading();
|
||||
}
|
||||
|
||||
export function getAPIServerUrl() {
|
||||
if (main_api == "textgenerationwebui") {
|
||||
if (isMancer()) {
|
||||
return MANCER_SERVER;
|
||||
}
|
||||
|
||||
return api_server_textgenerationwebui;
|
||||
}
|
||||
|
||||
if (main_api == "kobold") {
|
||||
return api_server;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
export async function selectCharacterById(id) {
|
||||
if (characters[id] == undefined) {
|
||||
return;
|
||||
@ -2534,16 +2542,6 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
main_api == 'textgenerationwebui' &&
|
||||
textgenerationwebui_settings.streaming &&
|
||||
textgenerationwebui_settings.type === textgen_types.OOBA &&
|
||||
!textgenerationwebui_settings.streaming_url) {
|
||||
toastr.error('Streaming URL is not set. Look it up in the console window when starting TextGen Web UI');
|
||||
unblockGeneration();
|
||||
return;
|
||||
}
|
||||
|
||||
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();
|
||||
|
Reference in New Issue
Block a user