From 803b7fca8941cb0bbce8c821f120f3ea3d080fa0 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 23 Nov 2024 17:50:32 +0200 Subject: [PATCH] Remove custom header --- public/script.js | 2 +- src/endpoints/backends/text-completions.js | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/public/script.js b/public/script.js index 2648f2fbe..57acf537e 100644 --- a/public/script.js +++ b/public/script.js @@ -1238,7 +1238,7 @@ async function getStatusTextgen() { const wantsInstructDerivation = (power_user.instruct.enabled && power_user.instruct.derived); const wantsContextDerivation = power_user.context_derived; - const supportsChatTemplate = response.headers.get('x-supports-chat-template') === 'true'; + const supportsChatTemplate = [textgen_types.KOBOLDCPP, textgen_types.LLAMACPP].includes(textgen_settings.type); if (supportsChatTemplate && (wantsInstructDerivation || wantsContextDerivation)) { const response = await fetch('/api/backends/text-completions/props', { method: 'POST', diff --git a/src/endpoints/backends/text-completions.js b/src/endpoints/backends/text-completions.js index 8a9a15101..34c215bce 100644 --- a/src/endpoints/backends/text-completions.js +++ b/src/endpoints/backends/text-completions.js @@ -219,9 +219,6 @@ router.post('/status', jsonParser, async function (request, response) { } catch (error) { console.error(`Failed to get TabbyAPI model info: ${error}`); } - } else if (apiType == TEXTGEN_TYPES.KOBOLDCPP || apiType == TEXTGEN_TYPES.LLAMACPP) { - // the /props endpoint includes chat template - response.setHeader('x-supports-chat-template', 'true'); } return response.send({ result, data: data.data });