Mancer will work in legacy API mode. Remove Soft Prompt mentions.

This commit is contained in:
Cohee 2023-11-08 18:16:47 +02:00
parent 2a5a780f3b
commit 480099ee97
6 changed files with 22 additions and 29 deletions

View File

@ -172,8 +172,6 @@
"Token Budget": "Token 预算",
"budget": "预算",
"Recursive scanning": "递归扫描",
"Soft Prompt": "软提示",
"About soft prompts": "关于软提示",
"None": "没有",
"User Settings": "聊天窗口设置",
"UI Customization": "聊天窗口定制",
@ -469,7 +467,7 @@
"Verifies your API connection by sending a short test message. Be aware that you'll be credited for it!": "通过发送一个短测试消息验证您的API连接。请注意您会获得相应的积分",
"Create New": "创建新的",
"Edit": "编辑",
"World Info & Soft Prompts": "世界背景 & 软提示",
"World Info": "世界背景",
"Locked = World Editor will stay open": "锁定=世界编辑器将保持打开状态",
"Entries can activate other entries by mentioning their keywords": "条目可以通过提及其关键字来激活其他条目",
"Lookup for the entry keys in the context will respect the case": "在上下文中查找条目键将遵守大小写",
@ -724,8 +722,6 @@
"Token Budget": "トークン予算",
"budget": "予算",
"Recursive scanning": "再帰的スキャン",
"Soft Prompt": "ソフトプロンプト",
"About soft prompts": "ソフトプロンプトについて",
"None": "なし",
"User Settings": "ユーザー設定",
"UI Customization": "UIカスタマイズ",
@ -1023,7 +1019,7 @@
"Verifies your API connection by sending a short test message. Be aware that you'll be credited for it!": "NEEDS TRANSLATION",
"Create New": "NEEDS TRANSLATION",
"Edit": "NEEDS TRANSLATION",
"World Info & Soft Prompts": "NEEDS TRANSLATION",
"World Info": "NEEDS TRANSLATION",
"Locked = World Editor will stay open": "NEEDS TRANSLATION",
"Entries can activate other entries by mentioning their keywords": "NEEDS TRANSLATION",
"Lookup for the entry keys in the context will respect the case": "NEEDS TRANSLATION",
@ -1278,8 +1274,6 @@
"Token Budget": "토큰 예산",
"budget": "예산",
"Recursive scanning": "되풀이 검색",
"Soft Prompt": "Soft Prompt",
"About soft prompts": "Soft prompt란?",
"None": "없음",
"User Settings": "사용자 설정",
"UI Customization": "UI 꾸미기",
@ -1581,7 +1575,7 @@
"Verifies your API connection by sending a short test message. Be aware that you'll be credited for it!": "짧은 시험 메시지를 보내서 API 접속 상태를 확인합니다. 서비스 사용으로 취급됩니다!",
"Create New": "새로 만들기",
"Edit": "수정하기",
"World Info & Soft Prompts": "세계관 & 소프트 프롬프트",
"World Info": "세계관",
"Locked = World Editor will stay open": "세계관 설정 패널 열림을 고정합니다",
"Entries can activate other entries by mentioning their keywords": "설정 내용에 다른 설정의 키워드가 있다면 연속으로 발동하게 합니다",
"Lookup for the entry keys in the context will respect the case": "설정 발동 키워드가 대소문자를 구분합니다",
@ -1890,8 +1884,6 @@
"Token Budget": "Объем токенов",
"budget": "объем",
"Recursive scanning": "Рекурсивное сканирование",
"Soft Prompt": "Мягкая инструкция",
"About soft prompts": "О мягких инструкциях",
"None": "Отсутствует",
"User Settings": "Настройки пользователя",
"UI Mode": "Режим интерфейса",
@ -2207,7 +2199,7 @@
"Verifies your API connection by sending a short test message. Be aware that you'll be credited for it!": "Подверждает ваше соединение к API. Знайте, что за это снимут деньги с вашего счета.",
"Create New": "Создать новое",
"Edit": "Изменить",
"World Info & Soft Prompts": "Информация о Мире & Мягкий Промт",
"World Info": "Информация о Мире",
"Locked = World Editor will stay open": "Закреплено = Редактирование Мира останется открытым",
"Entries can activate other entries by mentioning their keywords": "Записи могут активировать другие записи если в них содержаться ключевые слова",
"Lookup for the entry keys in the context will respect the case": "Большая буква имеет значение при активации ключевого слова",
@ -2469,8 +2461,6 @@
"Token Budget": "Budget per i Token",
"budget": "budget",
"Recursive scanning": "Analisi ricorsiva",
"Soft Prompt": "Prompt leggero",
"About soft prompts": "Riguardo i prompt leggeri",
"None": "None",
"User Settings": "Settaggi utente",
"UI Customization": "Personalizzazione UI",
@ -2767,7 +2757,7 @@
"Verifies your API connection by sending a short test message. Be aware that you'll be credited for it!": "Verifica la connessione all'API inviando un breve messaggio. Devi comprendere che il messaggio verrà addebitato come tutti gli altri!",
"Create New": "Crea nuovo",
"Edit": "Edita",
"World Info & Soft Prompts": "'Info Mondo' & Soft Prompt",
"World Info": "'Info Mondo'",
"Locked = World Editor will stay open": "Se clicchi il lucchetto, l'editor del mondo rimarrà aperto",
"Entries can activate other entries by mentioning their keywords": "Le voci possono attivare altre voci menzionando le loro parole chiave",
"Lookup for the entry keys in the context will respect the case": "Fai attenzione alle parole chiave usate, esse rispetteranno le maiuscole",
@ -2963,7 +2953,7 @@
"Show tags in responses": "Mostra i tag nelle risposte",
"Story String": "Stringa narrativa",
"Text Adventure": "Avventura testuale",
"Text Gen WebUI (ooba/Mancer) presets": "Preset Text Gen WebUI (ooba/Mancer)",
"Text Gen WebUI presets": "Preset Text Gen WebUI",
"Toggle Panels": "Interruttore pannelli",
"Top A Sampling": "Top A Sampling",
"Top K Sampling": "Top K Sampling",
@ -3226,8 +3216,6 @@
"Token Budget": "Token-budget",
"budget": "budget",
"Recursive scanning": "Recursieve scanning",
"Soft Prompt": "Zachte prompt",
"About soft prompts": "Over zachte prompts",
"None": "Geen",
"User Settings": "Gebruikersinstellingen",
"UI Customization": "UI-aanpassing",
@ -3523,7 +3511,7 @@
"Verifies your API connection by sending a short test message. Be aware that you'll be credited for it!": "Verifieert je API-verbinding door een kort testbericht te sturen. Wees je ervan bewust dat je hiervoor wordt gecrediteerd!",
"Create New": "Nieuw aanmaken",
"Edit": "Bewerken",
"World Info & Soft Prompts": "Wereldinformatie & Zachte Prompts",
"World Info": "Wereldinformatie",
"Locked = World Editor will stay open": "Vergrendeld = Wereld Editor blijft open",
"Entries can activate other entries by mentioning their keywords": "Invoeren kunnen andere invoeren activeren door hun trefwoorden te noemen",
"Lookup for the entry keys in the context will respect the case": "Zoeken naar de toetsen van de invoer in de context zal de hoofdlettergevoeligheid respecteren",

View File

@ -193,7 +193,7 @@
</div>
</div>
<div id="textgenerationwebui_api-presets">
<h4 class="margin0"><span data-i18n="Text Gen WebUI (ooba/Mancer) presets">Text Gen WebUI (ooba/Mancer) presets</span></h4>
<h4 class="margin0"><span data-i18n="Text Gen WebUI presets">Text Gen WebUI presets</span></h4>
<div class="flex-container">
<select id="settings_preset_textgenerationwebui" class="flex1 text_pole" data-preset-manager-for="textgenerationwebui">
</select>
@ -1513,7 +1513,7 @@
<select id="main_api">
<option value="kobold"><span data-i18n="KoboldAI">KoboldAI</span></option>
<option value="koboldhorde"><span data-i18n="KoboldAI Horde">KoboldAI Horde</span></option>
<option value="textgenerationwebui"><span data-i18n="Text Gen WebUI (ooba/Mancer)">Text Gen WebUI (ooba/Mancer)</span></option>
<option value="textgenerationwebui"><span data-i18n="Text Gen WebUI">Text Gen WebUI (ooba, Mancer, Aphrodite)</span></option>
<option value="novel"><span data-i18n="NovelAI">NovelAI</span></option>
<option value="openai"><span data-i18n="Chat Completion (OpenAI, Claude, Window/OpenRouter, Scale, AI21)">Chat Completion (OpenAI, Claude, Window, OpenRouter, Scale, AI21, PaLM)</span></option>
</select>
@ -2396,7 +2396,7 @@
<div id="WI-SP-button" class="drawer">
<div class="drawer-toggle drawer-header">
<div id="WIDrawerIcon" class="drawer-icon fa-solid fa-book-atlas closedIcon " title="World Info & Soft Prompts" data-i18n="[title]World Info & Soft Prompts"></div>
<div id="WIDrawerIcon" class="drawer-icon fa-solid fa-book-atlas closedIcon " title="World Info" data-i18n="[title]World Info"></div>
</div>
<div id="WorldInfo" class="drawer-content closedDrawer">
<div id="WorldInfoheader" class="fa-solid fa-grip drag-grabber"></div>

View File

@ -886,7 +886,7 @@ async function getStatus() {
use_mancer: main_api == "textgenerationwebui" ? isMancer() : false,
use_aphrodite: main_api == "textgenerationwebui" ? isAphrodite() : false,
use_ooba: main_api == "textgenerationwebui" ? isOoba() : false,
legacy_api: main_api == "textgenerationwebui" ? textgenerationwebui_settings.legacy_api : false,
legacy_api: main_api == "textgenerationwebui" ? textgenerationwebui_settings.legacy_api && !isMancer() : false,
}),
signal: abortStatusCheck.signal,
});
@ -2596,7 +2596,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
return;
}
if (main_api === 'textgenerationwebui' && textgenerationwebui_settings.streaming && textgenerationwebui_settings.legacy_api) {
if (main_api === 'textgenerationwebui' && textgenerationwebui_settings.streaming && textgenerationwebui_settings.legacy_api && !isMancer()) {
toastr.error('Streaming is not supported for the Legacy API. Update Ooba and use --extensions openai to enable streaming.', undefined, { timeOut: 10000, preventDuplicates: true, });
unblockGeneration();
return;

View File

@ -149,13 +149,18 @@ async function selectPreset(name) {
function formatTextGenURL(value) {
try {
// Mancer doesn't need any formatting (it's hardcoded)
if (isMancer()) {
return value;
}
const url = new URL(value);
if (url.pathname === '/api' && !textgenerationwebui_settings.legacy_api) {
toastr.info(`Enable Legacy API or start Ooba with the OpenAI extension enabled.`, 'Legacy API URL detected. Generation may fail.', { preventDuplicates: true, timeOut: 10000, extendedTimeOut: 20000 });
url.pathname = '';
}
if (!power_user.relaxed_api_urls && textgenerationwebui_settings.legacy_api && !isMancer()) {
if (!power_user.relaxed_api_urls && textgenerationwebui_settings.legacy_api) {
url.pathname = '/api';
}
return url.toString();
@ -522,7 +527,7 @@ export function getTextGenGenerationData(finalPrompt, this_amount_gen, isImperso
'use_aphrodite': isAphrodite(),
'use_ooba': isOoba(),
'api_server': isMancer() ? MANCER_SERVER : api_server_textgenerationwebui,
'legacy_api': textgenerationwebui_settings.legacy_api,
'legacy_api': textgenerationwebui_settings.legacy_api && !isMancer(),
//'n': textgenerationwebui_settings.n_aphrodite,
//'best_of': textgenerationwebui_settings.n_aphrodite, //n must always == best_of and vice versa
//'ignore_eos': textgenerationwebui_settings.ignore_eos_token_aphrodite,

View File

@ -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 { textgenerationwebui_settings } from "./textgen-settings.js";
import { isMancer, textgenerationwebui_settings } from "./textgen-settings.js";
export const CHARACTERS_PER_TOKEN_RATIO = 3.35;
const TOKENIZER_WARNING_KEY = 'tokenizationWarningShown';
@ -381,7 +381,7 @@ function countTokensRemote(endpoint, str, padding) {
text: str,
api: main_api,
url: getAPIServerUrl(),
legacy_api: main_api === 'textgenerationwebui' && textgenerationwebui_settings.legacy_api,
legacy_api: main_api === 'textgenerationwebui' && textgenerationwebui_settings.legacy_api && !isMancer() ,
}),
dataType: "json",
contentType: "application/json",

View File

@ -691,7 +691,7 @@ app.post("/getchat", jsonParser, function (request, response) {
}
});
// Only called for kobold and ooba/mancer
// Only called for kobold
app.post("/getstatus", jsonParser, async function (request, response) {
if (!request.body) return response.sendStatus(400);
api_server = request.body.api_server;