Add auto-select for instruct presets. Re-organize instruct mode code. Prepare for preset manager integration

This commit is contained in:
Cohee
2023-08-20 23:29:43 +03:00
parent 01cdcfa198
commit 6738ffe2a4
6 changed files with 289 additions and 199 deletions

View File

@ -8,6 +8,8 @@ import {
import { SECRET_KEYS, writeSecret } from "./secrets.js";
import { delay } from "./utils.js";
import { deviceInfo } from "./RossAscends-mods.js";
import { power_user } from "./power-user.js";
import { autoSelectInstructPreset } from "./instruct-mode.js";
export {
horde_settings,
@ -226,19 +228,11 @@ async function showKudos() {
jQuery(function () {
$("#horde_model").on('mousedown change', async function (e) {
//desktop-only routine for multi-select without CTRL
/*if (deviceInfo.device.type === 'desktop') {
let hordeModelSelectScrollTop = null;
e.preventDefault();
const option = $(e.target);
const selectElement = $(this)[0];
hordeModelSelectScrollTop = selectElement.scrollTop;
option.prop('selected', !option.prop('selected'));
await delay(1);
selectElement.scrollTop = hordeModelSelectScrollTop;
}*/
horde_settings.models = $('#horde_model').val();
console.log('Updated Horde models', horde_settings.models);
// Try select instruct preset
autoSelectInstructPreset(horde_settings.models.join(' '));
});
$("#horde_auto_adjust_response_length").on("input", function () {