mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add koboldcpp as Text Completion source
This commit is contained in:
@@ -28,7 +28,8 @@ export const textgen_types = {
|
||||
OOBA: 'ooba',
|
||||
MANCER: 'mancer',
|
||||
APHRODITE: 'aphrodite',
|
||||
TABBY: 'tabby'
|
||||
TABBY: 'tabby',
|
||||
KOBOLDCPP: 'koboldcpp',
|
||||
};
|
||||
|
||||
// Maybe let it be configurable in the future?
|
||||
@@ -292,6 +293,10 @@ export function isOoba() {
|
||||
return textgenerationwebui_settings.type === textgen_types.OOBA;
|
||||
}
|
||||
|
||||
export function isKoboldCpp() {
|
||||
return textgenerationwebui_settings.type === textgen_types.KOBOLDCPP;
|
||||
}
|
||||
|
||||
export function getTextGenUrlSourceId() {
|
||||
switch (textgenerationwebui_settings.type) {
|
||||
case textgen_types.OOBA:
|
||||
@@ -300,6 +305,8 @@ export function getTextGenUrlSourceId() {
|
||||
return "#aphrodite_api_url_text";
|
||||
case textgen_types.TABBY:
|
||||
return "#tabby_api_url_text";
|
||||
case textgen_types.KOBOLDCPP:
|
||||
return "#koboldcpp_api_url_text";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -559,6 +566,7 @@ export function getTextGenGenerationData(finalPrompt, this_amount_gen, isImperso
|
||||
'use_mancer': isMancer(),
|
||||
'use_aphrodite': isAphrodite(),
|
||||
'use_tabby': isTabby(),
|
||||
'use_koboldcpp': isKoboldCpp(),
|
||||
'use_ooba': isOoba(),
|
||||
'api_server': isMancer() ? MANCER_SERVER : api_server_textgenerationwebui,
|
||||
'legacy_api': textgenerationwebui_settings.legacy_api && !isMancer(),
|
||||
|
@@ -4,7 +4,7 @@ import { chat_completion_sources, model_list, oai_settings } from "./openai.js";
|
||||
import { groups, selected_group } from "./group-chats.js";
|
||||
import { getStringHash } from "./utils.js";
|
||||
import { kai_flags } from "./kai-settings.js";
|
||||
import { isMancer, isTabby, textgenerationwebui_settings } from "./textgen-settings.js";
|
||||
import { isKoboldCpp, isMancer, isTabby, textgenerationwebui_settings } from "./textgen-settings.js";
|
||||
|
||||
export const CHARACTERS_PER_TOKEN_RATIO = 3.35;
|
||||
const TOKENIZER_WARNING_KEY = 'tokenizationWarningShown';
|
||||
@@ -369,7 +369,8 @@ function getRemoteTokenizationParams(str) {
|
||||
api: main_api,
|
||||
url: getAPIServerUrl(),
|
||||
legacy_api: main_api === 'textgenerationwebui' && textgenerationwebui_settings.legacy_api && !isMancer(),
|
||||
use_tabby: isTabby()
|
||||
use_tabby: main_api === 'textgenerationwebui' && isTabby(),
|
||||
use_koboldcpp: main_api === 'textgenerationwebui' && isKoboldCpp(),
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user