From 5f93c30a968401f49c1dcb87fd38fb42deaf6027 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Fri, 5 Jan 2024 19:15:07 +0200 Subject: [PATCH] #1627 Bypass status check and custom model for textgen type --- public/index.html | 5 +++++ public/script.js | 5 +++++ public/scripts/preset-manager.js | 2 ++ public/scripts/textgen-settings.js | 8 ++++++++ 4 files changed, 20 insertions(+) diff --git a/public/index.html b/public/index.html index dfbdcf032..fef6e743e 100644 --- a/public/index.html +++ b/public/index.html @@ -1850,6 +1850,7 @@ Example: http://127.0.0.1:5000 +
@@ -1951,6 +1952,10 @@ Legacy API (pre-OAI, no streaming) +
diff --git a/public/script.js b/public/script.js index a437e6423..fb16babd8 100644 --- a/public/script.js +++ b/public/script.js @@ -954,6 +954,11 @@ async function getStatusTextgen() { return resultCheckStatus(); } + if (textgen_settings.type == OOBA && textgen_settings.bypass_status_check) { + online_status = 'Status check bypassed'; + return resultCheckStatus(); + } + try { const response = await fetch(url, { method: 'POST', diff --git a/public/scripts/preset-manager.js b/public/scripts/preset-manager.js index c16e8970e..e1a1717b2 100644 --- a/public/scripts/preset-manager.js +++ b/public/scripts/preset-manager.js @@ -311,6 +311,8 @@ class PresetManager { 'ollama_model', 'server_urls', 'type', + 'custom_model', + 'bypass_status_check', ]; const settings = Object.assign({}, getSettingsByApiId(this.apiId)); diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index 021bb375a..4f2bc6076 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -110,6 +110,8 @@ const settings = { logit_bias: [], n: 1, server_urls: {}, + custom_model: '', + bypass_status_check: false, }; export let textgenerationwebui_banned_in_macros = []; @@ -163,6 +165,8 @@ const setting_names = [ 'sampler_order', 'n', 'logit_bias', + 'custom_model', + 'bypass_status_check', ]; export function validateTextGenUrl() { @@ -665,6 +669,10 @@ function toIntArray(string) { } function getModel() { + if (settings.type === OOBA && settings.custom_model) { + return settings.custom_model; + } + if (settings.type === MANCER) { return settings.mancer_model; }