diff --git a/Update-Instructions.txt b/Update-Instructions.txt new file mode 100644 index 000000000..e8c88cd9b --- /dev/null +++ b/Update-Instructions.txt @@ -0,0 +1,55 @@ +How to Update SillyTavern + +This is not an installation guide. If you need installation instructions, look here: +https://docs.alpindale.dev/pygmalion-extras/sillytavern/#installation + +This guide assumes you have already installed SillyTavern once, and know how to run it on your OS. + +Linux/Termux: + +You definitely installed via git, so just 'git pull' inside the SillyTavern directory. + +Windows/MacOS: + +Method 1 - GIT + +We always recommend users install using 'git'. Here's why: + +When you have installed via `git clone`, all you have to do to update is type `git pull` in a command line in the ST folder. +The updates are applied automatically and safely. + +Method 2 - ZIP + +If you insist on installing via a zip, here is the tedious process for doing the update: + +1. Download the new release zip. +2. Unzip it into a folder OUTSIDE of your current ST installation. +3. Do the usual setup procedure for your OS to install the NodeJS requirements. + +4. Copy the following files/folders as necessary(*) from your old ST installation: + + - Backgrounds + - Characters + - Chats + - Groups + - Group chats + - KoboldAI Settings + - NovelAI Settings + - OpenAI Settings + - TextGen Settings (textgen = ooba) + - Themes + - User Avatars + - Worlds + - settings.json + + (*) 'As necessary' = "If you made any custom content related to those folders". + None of the folders are mandatory, so only copy what you need. + + **NB: DO NOT COPY THE ENTIRE /PUBLIC/ FOLDER.** + Doing so could break the new install and prevent new features from being present. + +5. Paste those items into the /Public/ folder of the new install. + +6. Start SillyTavern once again with the method appropriate to your OS, and pray you got it right. + +7. If everything shows up, you can safely delete the old ST folder. \ No newline at end of file diff --git a/public/notes/update.html b/public/notes/update.html new file mode 100644 index 000000000..97e31d5c8 --- /dev/null +++ b/public/notes/update.html @@ -0,0 +1,24 @@ + + + + + SillyTavern Guidebook + + + + + + + + + + +
+
+ + +
+
+ + + \ No newline at end of file diff --git a/public/notes/update.md b/public/notes/update.md new file mode 100644 index 000000000..e1781d4ac --- /dev/null +++ b/public/notes/update.md @@ -0,0 +1,64 @@ +# How to Update SillyTavern + +This is not an installation guide. If you need installation instructions, look here: + + +(This guide assumes you have already installed SillyTavern once and know how to run it on your OS.) + +(A plain text copy of this file is also present inside SillyTavern's base install folder.) + +---- + +## Linux/Termux + +You definitely installed via git, so just 'git pull' inside the SillyTavern directory. + +---- + +## Windows/MacOS + +### Method 1 - GIT + +We always recommend users install using 'git'. Here's why: + +When you have installed via 'git clone', all you have to do to update is type 'git pull' in a command line in the ST folder. +The updates are applied automatically and safely. + +### Method 2 - ZIP + +If you insist on installing via a zip, here is the tedious process for doing the update: + +1. Download the new release zip. +2. Unzip it into a folder OUTSIDE of your current ST installation. +3. Do the usual setup procedure for your OS to install NodeJS requirements. + +4. Copy the following files/folders as necessary(*) from your old ST installation: + + (*) 'As necessary' = "If you made any custom content related to those folders". + None of the folders are mandatory, so only copy what you need. + +#### NB: DO NOT COPY THE ENTIRE /PUBLIC/ FOLDER + + Doing so could break the new install and prevent new features from being present. + +```plaintext +Backgrounds +Characters +Chats +Groups +Group chats +KoboldAI Settings +NovelAI Settings +OpenAI Settings +TextGen Settings (textgen = ooba) +Themes +User Avatars +Worlds +settings.json +``` + +5. Once those folders/files are copied, Paste them into the /Public/ folder of the new install. + +6. Start SillyTavern once again with the method appropriate to your OS, and pray you got it right. + +7. If everything shows up, you can safely delete the old ST folder. diff --git a/public/script.js b/public/script.js index 2bcb1fdcd..f9c93d676 100644 --- a/public/script.js +++ b/public/script.js @@ -287,6 +287,8 @@ const system_messages = { is_name: true, mes: [ '

Welcome to SillyTavern!

', + '

Want to Update to the latest version?

', + "Read the instructions here. Also located in your installation's base folder", '

In order to begin chatting:

', '
    ', '
  1. Connect to one of the supported generation APIs (the plug icon)
  2. ', @@ -381,17 +383,17 @@ async function getClientVersion() { } function getTokenCount(str, padding = 0) { - let tokenizerType = power_user.tokenizer; + let tokenizerType = power_user.tokenizer; if (main_api === 'openai') { // For main prompt building if (padding == power_user.token_padding) { tokenizerType = tokenizers.NONE; - // For extensions and WI + // For extensions and WI } else { return getTokenCountOpenAI(str); } - + } switch (tokenizerType) { @@ -974,15 +976,15 @@ function messageFormatting(mes, ch_name, isSystem, isUser) { .replace(/\*\*(.+?)\*\*/g, "$1") .replace(/\n/g, "
    "); } else if (!isSystem) { - mes = mes.replace(/```[\s\S]*?```|``[\s\S]*?``|`[\s\S]*?`|(\".+?\")|(\u201C.+?\u201D)/gm, function (match, p1, p2) { - if (p1) { - return '"' + p1.replace(/\"/g, "") + '"'; - } else if (p2) { - return '“' + p2.replace(/\u201C|\u201D/g, "") + '”'; - } else { - return match; - } - }); + mes = mes.replace(/```[\s\S]*?```|``[\s\S]*?``|`[\s\S]*?`|(\".+?\")|(\u201C.+?\u201D)/gm, function (match, p1, p2) { + if (p1) { + return '"' + p1.replace(/\"/g, "") + '"'; + } else if (p2) { + return '“' + p2.replace(/\u201C|\u201D/g, "") + '”'; + } else { + return match; + } + }); mes = mes.replaceAll('\\begin{align*}', '$$'); mes = mes.replaceAll('\\end{align*}', '$$'); mes = converter.makeHtml(mes); @@ -1849,7 +1851,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject, if (main_api == 'openai') { break; } - + chatString = item + chatString; if (canFitMessages()) { //(The number of tokens in the entire promt) need fix, it must count correctly (added +120, so that the description of the character does not hide) //if (is_pygmalion && i == chat2.length-1) item='\n'+item; @@ -2502,7 +2504,7 @@ function cleanUpMessage(getMessage, isImpersonate) { getMessage = getMessage.replace(/You:/g, name1 + ':'); } - let nameToTrim = isImpersonate ? name2 : name1; + let nameToTrim = isImpersonate ? name2 : name1; if (isImpersonate) { nameToTrim = power_user.allow_name2_display ? '' : name2;