From 2478e17164c1d57ac4b1862faa1bd01178ef7124 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 15 Sep 2024 08:05:53 +0300 Subject: [PATCH] Remove legacy API for Aphrodite --- public/script.js | 4 ++-- public/scripts/textgen-settings.js | 4 ++-- public/scripts/tokenizers.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/script.js b/public/script.js index d2de51bbc..a5ad50717 100644 --- a/public/script.js +++ b/public/script.js @@ -1166,7 +1166,7 @@ async function getStatusTextgen() { body: JSON.stringify({ api_server: endpoint, api_type: textgen_settings.type, - legacy_api: textgen_settings.legacy_api && (textgen_settings.type === OOBA || textgen_settings.type === APHRODITE), + legacy_api: textgen_settings.legacy_api && textgen_settings.type === OOBA, }), signal: abortStatusCheck.signal, }); @@ -3365,7 +3365,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro if (main_api === 'textgenerationwebui' && textgen_settings.streaming && textgen_settings.legacy_api && - (textgen_settings.type === OOBA || textgen_settings.type === APHRODITE)) { + textgen_settings.type === OOBA) { toastr.error('Streaming is not supported for the Legacy API. Update Ooba and use new API to enable streaming.', undefined, { timeOut: 10000, preventDuplicates: true }); unblockGeneration(type); return Promise.resolve(); diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index c22ecee23..7ded8ce45 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -321,7 +321,7 @@ async function selectPreset(name) { function formatTextGenURL(value) { try { const noFormatTypes = [MANCER, TOGETHERAI, INFERMATICAI, DREAMGEN, OPENROUTER]; - const legacyApiTypes = [OOBA, APHRODITE]; + const legacyApiTypes = [OOBA]; if (noFormatTypes.includes(settings.type)) { return value; } @@ -1156,7 +1156,7 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, 'banned_strings': banned_strings, 'api_type': settings.type, 'api_server': getTextGenServer(), - 'legacy_api': settings.legacy_api && (settings.type === OOBA || settings.type === APHRODITE), + 'legacy_api': settings.legacy_api && settings.type === OOBA, 'sampler_order': settings.type === textgen_types.KOBOLDCPP ? settings.sampler_order : undefined, 'xtc_threshold': settings.xtc_threshold, 'xtc_probability': settings.xtc_probability, diff --git a/public/scripts/tokenizers.js b/public/scripts/tokenizers.js index 61884fe68..17d57cc5a 100644 --- a/public/scripts/tokenizers.js +++ b/public/scripts/tokenizers.js @@ -869,7 +869,7 @@ function getTextgenAPITokenizationParams(str) { text: str, api_type: textgen_settings.type, url: getTextGenServer(), - legacy_api: textgen_settings.legacy_api && (textgen_settings.type === OOBA || textgen_settings.type === APHRODITE), + legacy_api: textgen_settings.legacy_api && textgen_settings.type === OOBA, vllm_model: textgen_settings.vllm_model, aphrodite_model: textgen_settings.aphrodite_model, };