Merge branch 'sd_inline_image_generation' of https://github.com/sumit0k/SillyTavern into sumit0k/sd_inline_image_generation

This commit is contained in:
SillyLossy
2023-05-16 21:18:59 +03:00
2 changed files with 76 additions and 22 deletions

View File

@ -446,7 +446,7 @@ function getTokenCount(str, padding = undefined) {
let tokenCount = 0;
jQuery.ajax({
async: false,
type: 'POST', //
type: 'POST', //
url: `/tokenize_llama`,
data: JSON.stringify({ text: str }),
dataType: "json",
@ -588,7 +588,7 @@ $.get("/csrf-token").then(async (data) => {
});
function checkOnlineStatus() {
///////// REMOVED LINES THAT DUPLICATE RA_CHeckOnlineStatus FEATURES
///////// REMOVED LINES THAT DUPLICATE RA_CHeckOnlineStatus FEATURES
if (online_status == "no_connection") {
$("#online_status_indicator2").css("background-color", "red"); //Kobold
@ -1036,7 +1036,7 @@ function appendImageToMessage(mes, messageElement) {
image.src = mes.extra?.image;
image.title = mes.extra?.title || mes.title;
image.classList.add("img_extra");
messageElement.find(".mes_text").prepend(image);
mes.extra?.inline_image?messageElement.find(".mes_text").append(image):messageElement.find(".mes_text").prepend(image);
}
}
@ -1094,7 +1094,7 @@ function addOneMessage(mes, { type = "normal", insertAfter = null, scroll = true
avatarImg = default_avatar;
}
}
//old processing:
//old processing:
//if messge is from sytem, use the name provided in the message JSONL to proceed,
//if not system message, use name2 (char's name) to proceed
//characterName = mes.is_system || mes.force_avatar ? mes.name : name2;
@ -1963,7 +1963,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
// where it left off by removing the trailing newline at the end
// that was added by chat2 generator. This causes problems with
// instruct mode that could not have a trailing newline. So we're
// removing a newline ONLY at the end of the string if it exists.
// removing a newline ONLY at the end of the string if it exists.
item = item.replace(/\n?$/, '');
//item = item.substr(0, item.length - 1);
}
@ -2192,8 +2192,8 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
}
else {
jQuery.ajax({
type: 'POST', //
url: generate_url, //
type: 'POST', //
url: generate_url, //
data: JSON.stringify(generate_data),
beforeSend: function () {