Skip to content

Commit

Permalink
Merge branch 'SillyTavern:release' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
teralomaniac authored Oct 28, 2023
2 parents a64a235 + 97b9d99 commit 5e3dd25
Show file tree
Hide file tree
Showing 16 changed files with 185 additions and 115 deletions.
1 change: 0 additions & 1 deletion default/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"single_line": false,
"streaming_kobold": false,
"sampler_order": [
6,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"type": "git",
"url": "https://github.com/SillyTavern/SillyTavern.git"
},
"version": "1.10.6",
"version": "1.10.7",
"scripts": {
"start": "node server.js",
"start-multi": "node server.js --disableCsrf",
Expand Down
3 changes: 1 addition & 2 deletions public/context/Adventure.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"always_force_name2": false,
"trim_sentences": false,
"include_newline": false,
"custom_stopping_strings": "[\"\\n\"]",
"custom_stopping_strings_macro": true,
"single_line": true,
"name": "Adventure"
}
4 changes: 4 additions & 0 deletions public/css/st-tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
align-items: flex-end !important;
}

.alignItemsBaseline {
align-items: baseline !important;
}

.alignSelfStart {
align-self: start;
}
Expand Down
157 changes: 90 additions & 67 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,10 @@ <h4 class="margin0"><span data-i18n="Text Gen WebUI (ooba/Mancer) presets">Text
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="max_context" name="volume" min="512" max="4096" step="512">
<input type="range" id="max_context" name="volume" min="512" max="8192" step="64">
</div>
<div class="range-block-counter" data-randomization-disabled="true">
<input type="number" min="512" max="4096" step="512" data-for="max_context" id="max_context_counter">

<input type="number" min="512" max="8192" step="64" data-for="max_context" id="max_context_counter">
</div>
</div>
</div>
Expand Down Expand Up @@ -998,17 +997,6 @@ <h4 class="margin0"><span data-i18n="Text Gen WebUI (ooba/Mancer) presets">Text
</div>
</div>
</div>
<div class="range-block">
<label class="checkbox_label" for="single_line">
<input id="single_line" type="checkbox" /><span data-i18n="Single-line mode">
Single-line mode</span>
</label>
<div class="toggle-description justifyLeft">
<span data-i18n="Generate only one line per request (KoboldAI only, ignored by KoboldCpp).">
Generate only one line per request (KoboldAI only, ignored by KoboldCpp).
</span>
</div>
</div>
<div class="range-block">
<label class="checkbox_label" for="use_default_badwordsids">
<input id="use_default_badwordsids" type="checkbox" />
Expand Down Expand Up @@ -1091,6 +1079,14 @@ <h4 data-i18n="Grammar">Grammar</h4>
</div>
</div>
<hr>
<div class="range-block">
<div class="range-block-title" data-i18n="Seed">
Seed
</div>
<!-- Max value is 2**64 - 1 -->
<input type="number" id="seed_kobold" class="text_pole wide100p" min="-1" value="-1" max="18446744073709551615" />
</div>
<hr>
<div class="range-block flexFlowColumn">
<div class="range-block-title">
<span data-i18n="Samplers Order">Samplers Order</span>
Expand Down Expand Up @@ -2233,7 +2229,8 @@ <h4 data-i18n="PaLM API Key">PaLM API Key</h4>
<div class="drawer-icon fa-solid fa-font closedIcon" title="AI Response Formatting" data-i18n="[title]AI Response Formatting"></div>
</div>
<div class="drawer-content">
<h3 class="margin0" data-i18n="Advanced Formatting">Advanced Formatting
<h3 class="margin0" data-i18n="Advanced Formatting">
Advanced Formatting
<a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
</a>
Expand Down Expand Up @@ -2463,6 +2460,52 @@ <h4 data-i18n="Instruct Mode">Instruct Mode
</div>
</div>
<div id="ContextFormatting">
<div>
<div class="flex-container alignItemsBaseline">
<h4 data-i18n="Context Formatting">
Context Formatting
</h4>
<small>
&nbsp;(Saved to Context Template)
</small>
</div>
<label class="checkbox_label" for="always-force-name2-checkbox">
<input id="always-force-name2-checkbox" type="checkbox" />
<span data-i18n="Always add character's name to prompt">
Always add character's name to prompt
</span>
</label>
<label class="checkbox_label" for="single_line">
<input id="single_line" type="checkbox" />
<span data-i18n="Generate only one line per request">
Generate only one line per request
</span>
</label>
<label class="checkbox_label" for="trim_sentences_checkbox">
<input id="trim_sentences_checkbox" type="checkbox" />
<span data-i18n="Trim Incomplete Sentences">
Trim Incomplete Sentences
</span>
</label>
<!-- Add margin since this is a child of above -->
<label data-newbie-hidden class="checkbox_label indent20p" for="include_newline_checkbox">
<input id="include_newline_checkbox" type="checkbox" />
<span data-i18n="Include Newline">Include Newline</span>
</label>
</div>
<h4>
Misc. Settings
</h4>
<label class="checkbox_label" for="collapse-newlines-checkbox">
<input id="collapse-newlines-checkbox" type="checkbox" />
<span data-i18n="Remove Empty New Lines from Output">
Remove Empty New Lines from Output
</span>
</label>
<label data-newbie-hidden class="checkbox_label" for="trim_spaces">
<input id="trim_spaces" type="checkbox" />
<span data-i18n="Trim spaces">Trim spaces</span>
</label>
<div data-newbie-hidden>
<h4><span data-i18n="Tokenizer">Tokenizer</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/#tokenizer" class="notes-link" target="_blank">
Expand All @@ -2489,77 +2532,57 @@ <h4><span data-i18n="Tokenizer">Tokenizer</span>
</div>
<input id="token_padding" class="text_pole textarea_compact" type="number" min="-2048" max="2048" />
</div>
<label class="checkbox_label" for="always-force-name2-checkbox">
<input id="always-force-name2-checkbox" type="checkbox" />
<span data-i18n="Always add character's name to prompt">
Always add character's name to prompt
</span>
</label>
<label class="checkbox_label" for="collapse-newlines-checkbox"><input id="collapse-newlines-checkbox" type="checkbox" />
<span data-i18n="Remove Empty New Lines from Output">
Remove Empty New Lines from Output
</span>
</label>
<label data-newbie-hidden class="checkbox_label" for="trim_spaces">
<input id="trim_spaces" type="checkbox" />
<span data-i18n="Trim spaces">Trim spaces</span>
</label>
<label class="checkbox_label" for="trim_sentences_checkbox">
<input id="trim_sentences_checkbox" type="checkbox" />
<span data-i18n="Trim Incomplete Sentences">Trim Incomplete Sentences</span>
</label>
<!-- Add margin since this is a child of above -->
<label data-newbie-hidden class="checkbox_label indent20p" for="include_newline_checkbox">
<input id="include_newline_checkbox" type="checkbox" />
<span data-i18n="Include Newline">Include Newline</span>
</label>
<div data-newbie-hidden>
<h4>
<span data-i18n="Start Reply With">
Start Reply With
</span>
</h4>
<div class="flex-container flexFlowColumn" data-newbie-hidden>
<div>
<textarea id="start_reply_with" rows="2" class="text_pole textarea_compact" data-i18n="[placeholder]AI reply prefix" placeholder="AI reply prefix"></textarea>
<h4 class="range-block-title justifyLeft">
<span data-i18n="Start Reply With">
Start Reply With
</span>
</h4>
<div>
<textarea id="start_reply_with" rows="2" class="text_pole textarea_compact" data-i18n="[placeholder]AI reply prefix" placeholder="AI reply prefix"></textarea>
</div>
<label class="checkbox_label" for="chat-show-reply-prefix-checkbox">
<input id="chat-show-reply-prefix-checkbox" type="checkbox" />
<span data-i18n="Show reply prefix in chat">
Show reply prefix in chat
</span>
</label>
</div>
<label class="checkbox_label" for="chat-show-reply-prefix-checkbox"><input id="chat-show-reply-prefix-checkbox" type="checkbox" />
<span data-i18n="Show reply prefix in chat">
Show reply prefix in chat
</span>
</label>
<div>
<h4 data-i18n="Non-markdown strings">
Non-markdown strings
<h4 class="range-block-title justifyLeft">
<span data-i18n="Non-markdown strings">
Non-markdown strings
</span>
</h4>
<div>
<input id="markdown_escape_strings" class="text_pole textarea_compact" type="text" data-i18n="[placeholder]separate with commas w/o space between" placeholder="separate with commas w/o space between" maxlength="100" />
</div>
</div>
<h4>
<div class="range-block-title justifyLeft">
<div>
<h4 class="range-block-title justifyLeft">
<span data-i18n="Custom Stopping Strings">
Custom Stopping Strings
</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/#custom-stopping-strings" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
</a>
</div>
</h4>
<div>
<small>
<span data-i18n="JSON serialized array of strings">JSON serialized array of strings, for example:</span><br>
<span class="monospace">["\n", "\nUser:", "\nChar:"]</span>
<span data-i18n="JSON serialized array of strings">JSON serialized array of strings</span>
</small>
</div>
</h4>
<div>
<textarea id="custom_stopping_strings" rows="2" class="text_pole textarea_compact monospace" placeholder="[&quot;Ford&quot;, &quot;BMW&quot;, &quot;Fiat&quot;]"></textarea>
<div>
<textarea id="custom_stopping_strings" rows="2" class="text_pole textarea_compact monospace" placeholder="[&quot;Ford&quot;, &quot;BMW&quot;, &quot;Fiat&quot;]"></textarea>
</div>
<label class="checkbox_label" for="custom_stopping_strings_macro">
<input id="custom_stopping_strings_macro" type="checkbox" checked>
<span data-i18n="Replace Macro in Custom Stopping Strings">
Replace Macro in Custom Stopping Strings
</span>
</label>
</div>
<label class="checkbox_label" for="custom_stopping_strings_macro">
<input id="custom_stopping_strings_macro" type="checkbox" checked>
<span data-i18n="Replace Macro in Custom Stopping Strings">
Replace Macro in Custom Stopping Strings
</span>
</label>
</div>
<div data-newbie-hidden>
<h4>
Expand Down
9 changes: 7 additions & 2 deletions public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ import {
onlyUnique,
} from "./scripts/utils.js";

import { ModuleWorkerWrapper, extension_settings, getContext, loadExtensionSettings, processExtensionHelpers, registerExtensionHelper, renderExtensionTemplate, runGenerationInterceptors, saveMetadataDebounced } from "./scripts/extensions.js";
import { ModuleWorkerWrapper, doDailyExtensionUpdatesCheck, extension_settings, getContext, loadExtensionSettings, processExtensionHelpers, registerExtensionHelper, renderExtensionTemplate, runGenerationInterceptors, saveMetadataDebounced } from "./scripts/extensions.js";
import { COMMENT_NAME_DEFAULT, executeSlashCommands, getSlashCommandsHelp, registerSlashCommand } from "./scripts/slash-commands.js";
import {
tag_map,
Expand Down Expand Up @@ -728,6 +728,7 @@ async function firstLoadInit() {
initRossMods();
initStats();
initCfg();
doDailyExtensionUpdatesCheck();
}

function checkOnlineStatus() {
Expand Down Expand Up @@ -1840,6 +1841,10 @@ function getStoppingStrings(isImpersonate) {
result.push(...customStoppingStrings);
}

if (power_user.single_line) {
result.unshift('\n');
}

return result.filter(onlyUnique);
}

Expand Down Expand Up @@ -8815,7 +8820,7 @@ jQuery(async function () {
}

restoreCaretPosition($(this).get(0), caretPosition);
}, 500);
}, 2000);
})

$(".user_stats_button").on('click', function () {
Expand Down
15 changes: 10 additions & 5 deletions public/scripts/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,9 @@ export async function installExtension(url) {
});

if (!request.ok) {
toastr.info(request.statusText, 'Extension installation failed');
console.error('Extension installation failed', request.status, request.statusText);
const text = await request.text();
toastr.warning(text || request.statusText, 'Extension installation failed', { timeOut: 5000 });
console.error('Extension installation failed', request.status, request.statusText, text);
return;
}

Expand Down Expand Up @@ -773,10 +774,14 @@ async function loadExtensionSettings(settings, versionChanged) {
if (extension_settings.autoConnect && extension_settings.apiUrl) {
connectToApi(extension_settings.apiUrl);
}
}

if (extension_settings.notifyUpdates) {
checkForExtensionUpdates(false);
}
export function doDailyExtensionUpdatesCheck() {
setTimeout(() => {
if (extension_settings.notifyUpdates) {
checkForExtensionUpdates(false);
}
}, 1);
}

/**
Expand Down
8 changes: 8 additions & 0 deletions public/scripts/extensions/assets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ function downloadAssetsList(url) {
for (const assetType of assetTypes) {
let assetTypeMenu = $('<div />', { id: "assets_audio_ambient_div", class: "assets-list-div" });
assetTypeMenu.append(`<h3>${assetType}</h3>`)

if (assetType == 'extension') {
assetTypeMenu.append(`
<div class="assets-list-git">
To download extensions from this page, you need to have <a href="https://git-scm.com/downloads" target="_blank">Git</a> installed.
</div>`);
}

for (const i in availableAssets[assetType]) {
const asset = availableAssets[assetType][i];
const elemId = `assets_install_${assetType}_${i}`;
Expand Down
8 changes: 7 additions & 1 deletion public/scripts/extensions/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@
padding: 5px;
}

.assets-list-git {
font-size: calc(var(--mainFontSize) * 0.8);
opacity: 0.8;
margin-bottom: 1em;
}

.assets-list-div h3 {
text-transform: capitalize;
}

.assets-list-div a {
.assets-list-div i a {
color: inherit;
}

Expand Down
Loading

0 comments on commit 5e3dd25

Please sign in to comment.