mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'dev' of https://github.com/Cohee1207/SillyTavern into dev
This commit is contained in:
@ -1026,7 +1026,7 @@
|
||||
<div class="fa-solid fa-repeat "></div>
|
||||
</div>
|
||||
</h4>
|
||||
<small class="horde_multiple_hint">Hold Control / Command key to select multiple models.</small>
|
||||
<small class="horde_multiple_hint">You can select multiple models.</small>
|
||||
<select id="horde_model" multiple>
|
||||
<option>-- Horde models not loaded --</option>
|
||||
</select>
|
||||
@ -1798,7 +1798,7 @@
|
||||
<input id="auto_swipe_minimum_length" name="auto_swipe_minimum_length" type="number" min="0" step="1" value="0" class="text_pole">
|
||||
<div>Blacklisted words</div>
|
||||
<div class="auto_swipe">
|
||||
<textarea id="auto_swipe_blacklist" name="auto_swipe_blacklist" placeholder="words you dont want generated separated by comma ','" class="text_pole textarea_compact" maxlength="500" value="" autocomplete="off" rows="3"></textarea>
|
||||
<textarea id="auto_swipe_blacklist" name="auto_swipe_blacklist" placeholder="words you dont want generated separated by comma ','" class="text_pole textarea_compact" maxlength="5000" value="" autocomplete="off" rows="3"></textarea>
|
||||
<div>Blacklisted word count to swipe</div>
|
||||
<input id="auto_swipe_blacklist_threshold" name="auto_swipe_blacklist_threshold" type="number" min="0" step="1" value="1" class="text_pole">
|
||||
</div>
|
||||
|
@ -1,4 +1,10 @@
|
||||
import { saveSettingsDebounced, changeMainAPI, callPopup, setGenerationProgress, CLIENT_VERSION, getRequestHeaders } from "../script.js";
|
||||
import {
|
||||
saveSettingsDebounced,
|
||||
callPopup,
|
||||
setGenerationProgress,
|
||||
CLIENT_VERSION,
|
||||
getRequestHeaders,
|
||||
} from "../script.js";
|
||||
import { SECRET_KEYS, writeSecret } from "./secrets.js";
|
||||
import { delay } from "./utils.js";
|
||||
import { deviceInfo } from "./RossAscends-mods.js";
|
||||
@ -216,34 +222,25 @@ async function showKudos() {
|
||||
toastr.info(`Kudos: ${data.kudos}`, data.username);
|
||||
}
|
||||
|
||||
|
||||
|
||||
jQuery(function () {
|
||||
|
||||
var hordeModelSelectScrollTop = null;
|
||||
$("#horde_model").on('mousedown change', function (e) {
|
||||
let hordeModelSelectScrollTop = null;
|
||||
|
||||
$("#horde_model").on('mousedown change', async function (e) {
|
||||
//desktop-only routine for multi-select without CTRL
|
||||
if (deviceInfo.device.type === 'desktop') {
|
||||
e.preventDefault();
|
||||
var option = $(e.target);
|
||||
var selectElement = $(this)[0];
|
||||
const option = $(e.target);
|
||||
const selectElement = $(this)[0];
|
||||
hordeModelSelectScrollTop = selectElement.scrollTop;
|
||||
option.prop('selected', !option.prop('selected'));
|
||||
setTimeout(function () {
|
||||
selectElement.scrollTop = hordeModelSelectScrollTop;
|
||||
}, 1)
|
||||
await delay(1);
|
||||
selectElement.scrollTop = hordeModelSelectScrollTop;
|
||||
}
|
||||
horde_settings.models = $('#horde_model').val();
|
||||
console.log('Updated Horde models', horde_settings.models);
|
||||
});
|
||||
|
||||
/* $("#horde_model").on("change", function () {
|
||||
horde_settings.models = $('#horde_model').val();
|
||||
console.log('Updated Horde models', horde_settings.models);
|
||||
saveSettingsDebounced();
|
||||
}); */
|
||||
|
||||
|
||||
$("#horde_auto_adjust_response_length").on("input", function () {
|
||||
horde_settings.auto_adjust_response_length = !!$(this).prop("checked");
|
||||
saveSettingsDebounced();
|
||||
|
@ -3938,7 +3938,8 @@ toolcool-color-picker {
|
||||
}
|
||||
|
||||
.neutral_warning {
|
||||
color: rgba(255, 0, 0, 0.5)
|
||||
color: rgba(225, 0, 0, 0.9);
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.max_context_unlocked_block .checkbox_label {
|
||||
|
34
server.js
34
server.js
@ -1708,6 +1708,40 @@ app.post("/importchat", urlencodedParser, function (request, response) {
|
||||
response.send('Errors occurred while writing character files. Errors: ' + JSON.stringify(errors));
|
||||
}
|
||||
|
||||
response.send({ res: true });
|
||||
} else if (Array.isArray(jsonData.data_visible)) {
|
||||
// oobabooga's format
|
||||
const chat = [{
|
||||
user_name: 'You',
|
||||
character_name: ch_name,
|
||||
create_date: humanizedISO8601DateTime(),
|
||||
}];
|
||||
|
||||
for (const arr of jsonData.data_visible) {
|
||||
if (arr[0]) {
|
||||
const userMessage = {
|
||||
name: 'You',
|
||||
is_user: true,
|
||||
is_name: true,
|
||||
send_date: humanizedISO8601DateTime(),
|
||||
mes: arr[0],
|
||||
};
|
||||
chat.push(userMessage);
|
||||
}
|
||||
if (arr[1]) {
|
||||
const charMessage = {
|
||||
name: ch_name,
|
||||
is_user: false,
|
||||
is_name: true,
|
||||
send_date: humanizedISO8601DateTime(),
|
||||
mes: arr[1],
|
||||
};
|
||||
chat.push(charMessage);
|
||||
}
|
||||
}
|
||||
|
||||
fs.writeFileSync(`${chatsPath + avatar_url}/${ch_name} - ${humanizedISO8601DateTime()} imported.jsonl`, chat.map(JSON.stringify).join('\n'), 'utf8');
|
||||
|
||||
response.send({ res: true });
|
||||
} else {
|
||||
response.send({ error: true });
|
||||
|
Reference in New Issue
Block a user