mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Ooobabooga settings to separate file
This commit is contained in:
@@ -48,6 +48,7 @@
|
|||||||
<script type="module" src="scripts/group-chats.js"></script>
|
<script type="module" src="scripts/group-chats.js"></script>
|
||||||
<script type="module" src="scripts/power-user.js"></script>
|
<script type="module" src="scripts/power-user.js"></script>
|
||||||
<script type="module" src="scripts/kai-settings.js"></script>
|
<script type="module" src="scripts/kai-settings.js"></script>
|
||||||
|
<script type="module" src="scripts/textgen-settings.js"></script>
|
||||||
|
|
||||||
<title>Tavern.AI</title>
|
<title>Tavern.AI</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -122,7 +123,7 @@
|
|||||||
<h4>API key</h4>
|
<h4>API key</h4>
|
||||||
<h5>Where to get (<a href="/notes/6" target="_blank">?</a>)</h5>
|
<h5>Where to get (<a href="/notes/6" target="_blank">?</a>)</h5>
|
||||||
<input id="api_key_novel" name="api_key_novel" class="text_pole" maxlength="500" size="35" value="" autocomplete="off">
|
<input id="api_key_novel" name="api_key_novel" class="text_pole" maxlength="500" size="35" value="" autocomplete="off">
|
||||||
<input id="api_button_novel" type="submit" value="Connect">
|
<input id="api_button_novel" class="menu_button" type="submit" value="Connect">
|
||||||
<img id="api_loading_novel" src="img/load.svg">
|
<img id="api_loading_novel" src="img/load.svg">
|
||||||
</form>
|
</form>
|
||||||
<div id="online_status3">
|
<div id="online_status3">
|
||||||
@@ -137,11 +138,13 @@
|
|||||||
<select id="model_novel_select" class="option_select_right_menu" style='margin-bottom: 16px;'>
|
<select id="model_novel_select" class="option_select_right_menu" style='margin-bottom: 16px;'>
|
||||||
<option value="euterpe-v2">Euterpe</option>
|
<option value="euterpe-v2">Euterpe</option>
|
||||||
<option value="krake-v2">Krake</option>
|
<option value="krake-v2">Krake</option>
|
||||||
</select><br>
|
</select>
|
||||||
|
<h4>
|
||||||
Preset settings
|
Preset settings
|
||||||
<a href="/notes/7" class="notes-link" target="_blank">
|
<a href="/notes/7" class="notes-link" target="_blank">
|
||||||
<span class="note-link-span">?</span>
|
<span class="note-link-span">?</span>
|
||||||
</a><br>
|
</a>
|
||||||
|
</h4>
|
||||||
<select id="settings_perset_novel" class="option_select_right_menu">
|
<select id="settings_perset_novel" class="option_select_right_menu">
|
||||||
<option value="gui">Default</option>
|
<option value="gui">Default</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -152,12 +155,15 @@
|
|||||||
oobabooga/text-generation-webui
|
oobabooga/text-generation-webui
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<span>Make sure you run it:
|
<span>
|
||||||
|
Make sure you run it:
|
||||||
<ul>
|
<ul>
|
||||||
<li>with
|
<li>
|
||||||
|
with
|
||||||
<pre>--no-stream</pre> option
|
<pre>--no-stream</pre> option
|
||||||
</li>
|
</li>
|
||||||
<li>in notebook mode (not
|
<li>
|
||||||
|
in notebook mode (not
|
||||||
<pre>--cai-chat</pre> or
|
<pre>--cai-chat</pre> or
|
||||||
<pre>--chat</pre>)
|
<pre>--chat</pre>)
|
||||||
</li>
|
</li>
|
||||||
|
@@ -6,6 +6,11 @@ import {
|
|||||||
loadKoboldSettings,
|
loadKoboldSettings,
|
||||||
} from "./scripts/kai-settings.js";
|
} from "./scripts/kai-settings.js";
|
||||||
|
|
||||||
|
import {
|
||||||
|
textgenerationwebui_settings,
|
||||||
|
loadTextGenSettings,
|
||||||
|
} from "./scripts/textgen-settings.js";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
world_info_budget,
|
world_info_budget,
|
||||||
world_info_data,
|
world_info_data,
|
||||||
@@ -245,16 +250,6 @@ var user_avatar = "you.png";
|
|||||||
var amount_gen = 80; //default max length of AI generated responses
|
var amount_gen = 80; //default max length of AI generated responses
|
||||||
var max_context = 2048;
|
var max_context = 2048;
|
||||||
|
|
||||||
var textgenerationwebui_settings = {
|
|
||||||
temp: 0.5,
|
|
||||||
top_p: 0.9,
|
|
||||||
top_k: 0,
|
|
||||||
typical_p: 1,
|
|
||||||
rep_pen: 1.1,
|
|
||||||
rep_pen_size: 0,
|
|
||||||
penalty_alpha: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
var is_pygmalion = false;
|
var is_pygmalion = false;
|
||||||
var tokens_already_generated = 0;
|
var tokens_already_generated = 0;
|
||||||
var message_already_generated = "";
|
var message_already_generated = "";
|
||||||
@@ -1973,8 +1968,7 @@ async function getSettings(type) {
|
|||||||
|
|
||||||
//Load AI model config settings (temp, context length, anchors, and anchor order)
|
//Load AI model config settings (temp, context length, anchors, and anchor order)
|
||||||
|
|
||||||
textgenerationwebui_settings =
|
loadTextGenSettings(settings.textgenerationwebui_settings);
|
||||||
settings.textgenerationwebui_settings || textgenerationwebui_settings;
|
|
||||||
|
|
||||||
amount_gen = settings.amount_gen;
|
amount_gen = settings.amount_gen;
|
||||||
if (settings.max_context !== undefined)
|
if (settings.max_context !== undefined)
|
||||||
@@ -2084,23 +2078,6 @@ async function getSettings(type) {
|
|||||||
api_server_textgenerationwebui
|
api_server_textgenerationwebui
|
||||||
);
|
);
|
||||||
|
|
||||||
for (var i of [
|
|
||||||
"temp",
|
|
||||||
"rep_pen",
|
|
||||||
"rep_pen_size",
|
|
||||||
"top_k",
|
|
||||||
"top_p",
|
|
||||||
"typical_p",
|
|
||||||
"penalty_alpha",
|
|
||||||
]) {
|
|
||||||
$("#" + i + "_textgenerationwebui").val(
|
|
||||||
textgenerationwebui_settings[i]
|
|
||||||
);
|
|
||||||
$("#" + i + "_counter_textgenerationwebui").html(
|
|
||||||
textgenerationwebui_settings[i]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
selected_button = settings.selected_button;
|
selected_button = settings.selected_button;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3712,31 +3689,6 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (var i of [
|
|
||||||
"temp",
|
|
||||||
"rep_pen",
|
|
||||||
"rep_pen_size",
|
|
||||||
"top_k",
|
|
||||||
"top_p",
|
|
||||||
"typical_p",
|
|
||||||
"penalty_alpha",
|
|
||||||
]) {
|
|
||||||
$("#" + i + "_textgenerationwebui").attr("x-setting-id", i);
|
|
||||||
$(document).on("input", "#" + i + "_textgenerationwebui", function () {
|
|
||||||
var i = $(this).attr("x-setting-id");
|
|
||||||
var val = $(this).val();
|
|
||||||
if (isInt(val)) {
|
|
||||||
$("#" + i + "_counter_textgenerationwebui").html($(this).val() + ".00");
|
|
||||||
} else {
|
|
||||||
$("#" + i + "_counter_textgenerationwebui").html($(this).val());
|
|
||||||
}
|
|
||||||
textgenerationwebui_settings[i] = parseFloat(val);
|
|
||||||
saveSettingsDebounced();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////// OPTIMIZED RANGE SLIDER LISTENERS////////////////
|
////////////////// OPTIMIZED RANGE SLIDER LISTENERS////////////////
|
||||||
|
|
||||||
const sliders = [
|
const sliders = [
|
||||||
|
51
public/scripts/textgen-settings.js
Normal file
51
public/scripts/textgen-settings.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import {
|
||||||
|
saveSettingsDebounced,
|
||||||
|
} from "../script.js";
|
||||||
|
|
||||||
|
export {
|
||||||
|
textgenerationwebui_settings,
|
||||||
|
loadTextGenSettings,
|
||||||
|
}
|
||||||
|
|
||||||
|
let textgenerationwebui_settings = {
|
||||||
|
temp: 0.5,
|
||||||
|
top_p: 0.9,
|
||||||
|
top_k: 0,
|
||||||
|
typical_p: 1,
|
||||||
|
rep_pen: 1.1,
|
||||||
|
rep_pen_size: 0,
|
||||||
|
penalty_alpha: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
const setting_names = [
|
||||||
|
"temp",
|
||||||
|
"rep_pen",
|
||||||
|
"rep_pen_size",
|
||||||
|
"top_k",
|
||||||
|
"top_p",
|
||||||
|
"typical_p",
|
||||||
|
"penalty_alpha",
|
||||||
|
];
|
||||||
|
|
||||||
|
function loadTextGenSettings(settings) {
|
||||||
|
textgenerationwebui_settings = settings ? settings : textgenerationwebui_settings;
|
||||||
|
|
||||||
|
for (const i of setting_names) {
|
||||||
|
const val = parseFloat(textgenerationwebui_settings[i]);
|
||||||
|
$(`#${i}_textgenerationwebui`).val(val);
|
||||||
|
$(`#${i}_counter_textgenerationwebui`).text(val.toFixed(2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
for (const i of setting_names) {
|
||||||
|
$(`#${i}_textgenerationwebui`).attr("x-setting-id", i);
|
||||||
|
$(document).on("input", `#${i}_textgenerationwebui`, function () {
|
||||||
|
const id = $(this).attr("x-setting-id");
|
||||||
|
const val = parseFloat($(this).val());
|
||||||
|
$(`#${id}_counter_textgenerationwebui`).text(val.toFixed(2));
|
||||||
|
textgenerationwebui_settings[id] = parseFloat(val);
|
||||||
|
saveSettingsDebounced();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
@@ -787,7 +787,8 @@ img[src*="user-slash-solid.svg"] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#api_button:hover,
|
#api_button:hover,
|
||||||
#api_button_novel:hover {
|
#api_button_novel:hover,
|
||||||
|
#api_button_textgenerationwebui {
|
||||||
background-color: green;
|
background-color: green;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user