#1627 Bypass status check and custom model for textgen type

This commit is contained in:
Cohee 2024-01-05 19:15:07 +02:00
parent 394e703d92
commit 5f93c30a96
4 changed files with 20 additions and 0 deletions

View File

@ -1850,6 +1850,7 @@
<small data-i18n="Example: http://127.0.0.1:5000 ">Example: http://127.0.0.1:5000</small>
<input id="textgenerationwebui_api_url_text" name="textgenerationwebui_api_url" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" data-server-history="ooba_blocking">
</div>
<input id="custom_model_textgenerationwebui" class="text_pole wide100p" maxlength="500" placeholder="Custom model (optional)" type="text">
</div>
<div data-tg-type="aphrodite">
<div class="flex-container flexFlowColumn">
@ -1951,6 +1952,10 @@
<input type="checkbox" id="legacy_api_textgenerationwebui" />
<span data-i18n="Legacy API (pre-OAI, no streaming)">Legacy API (pre-OAI, no streaming)</span>
</label>
<label data-tg-type="ooba" class="checkbox_label margin-bot-10px" for="bypass_status_check_textgenerationwebui">
<input type="checkbox" id="bypass_status_check_textgenerationwebui" />
<span data-i18n="Bypass status check">Bypass status check</span>
</label>
</form>
<div class="online_status">
<div class="online_status_indicator"></div>

View File

@ -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',

View File

@ -311,6 +311,8 @@ class PresetManager {
'ollama_model',
'server_urls',
'type',
'custom_model',
'bypass_status_check',
];
const settings = Object.assign({}, getSettingsByApiId(this.apiId));

View File

@ -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;
}