sillytavern 1.9.1 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/readme.md +2 -2
- package/package.json +1 -1
- package/public/TextGen Settings/Asterism.settings +1 -0
- package/public/TextGen Settings/Beam Search.settings +1 -0
- package/public/TextGen Settings/Big O.settings +1 -0
- package/public/TextGen Settings/Contrastive Search.settings +1 -0
- package/public/TextGen Settings/Default.settings +1 -0
- package/public/TextGen Settings/Deterministic.settings +1 -0
- package/public/TextGen Settings/Divine Intellect.settings +1 -0
- package/public/TextGen Settings/Kobold (Godlike).settings +1 -0
- package/public/TextGen Settings/Kobold (Liminal Drift).settings +1 -0
- package/public/TextGen Settings/LLaMa-Precise.settings +1 -0
- package/public/TextGen Settings/Midnight Enigma.settings +1 -0
- package/public/TextGen Settings/Mirostat.settings +1 -0
- package/public/TextGen Settings/Naive.settings +1 -0
- package/public/TextGen Settings/NovelAI (Best Guess).settings +1 -0
- package/public/TextGen Settings/NovelAI (Decadence).settings +1 -0
- package/public/TextGen Settings/NovelAI (Genesis).settings +1 -0
- package/public/TextGen Settings/NovelAI (Lycaenidae).settings +1 -0
- package/public/TextGen Settings/NovelAI (Ouroboros).settings +1 -0
- package/public/TextGen Settings/NovelAI (Pleasing Results).settings +1 -0
- package/public/TextGen Settings/NovelAI (Sphinx Moth).settings +1 -0
- package/public/TextGen Settings/NovelAI (Storywriter).settings +1 -0
- package/public/TextGen Settings/Pygmalion.settings +1 -0
- package/public/TextGen Settings/Shortwave.settings +1 -0
- package/public/TextGen Settings/Simple-1.settings +1 -0
- package/public/TextGen Settings/Space Alien.settings +1 -0
- package/public/TextGen Settings/StarChat.settings +1 -0
- package/public/TextGen Settings/TFS-with-Top-A.settings +1 -0
- package/public/TextGen Settings/Titanic.settings +1 -0
- package/public/TextGen Settings/Yara.settings +1 -0
- package/public/index.html +22 -5
- package/public/instruct/Llama2.json +10 -0
- package/public/script.js +3 -2
- package/public/scripts/jquery.ui.touch-punch.min.js +11 -0
- package/public/scripts/openai.js +3 -29
- package/public/scripts/power-user.js +1 -1
- package/public/scripts/stats.js +13 -0
- package/public/scripts/textgen-settings.js +3 -0
- package/server.js +4 -2
package/.github/readme.md
CHANGED
|
@@ -144,8 +144,8 @@ An easy-to-follow guide with pretty pictures:
|
|
|
144
144
|
5. Open a Command Prompt inside that folder by clicking in the 'Address Bar' at the top, typing `cmd`, and pressing Enter.
|
|
145
145
|
6. Once the black box (Command Prompt) pops up, type ONE of the following into it and press Enter:
|
|
146
146
|
|
|
147
|
-
* for
|
|
148
|
-
* for
|
|
147
|
+
* for Release Branch: `git clone https://github.com/SillyTavern/SillyTavern -b release`
|
|
148
|
+
* for Staging Branch: `git clone https://github.com/SillyTavern/SillyTavern -b staging`
|
|
149
149
|
|
|
150
150
|
7. Once everything is cloned, double-click `Start.bat` to make NodeJS install its requirements.
|
|
151
151
|
8. The server will then start, and SillyTavern will pop up in your browser.
|
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
<script src="scripts/jquery-ui.min.js"></script>
|
|
27
27
|
<script src="scripts/jquery.transit.min.js"></script>
|
|
28
28
|
<script src="scripts/jquery-cookie-1.4.1.min.js"></script>
|
|
29
|
+
<script src="scripts/jquery.ui.touch-punch.min.js"></script>
|
|
29
30
|
<script src="scripts/showdown.min.js"></script>
|
|
30
31
|
<script src="scripts/showdown-katex.min.js"></script>
|
|
31
32
|
<script src="scripts/popper.js"></script>
|
|
@@ -201,7 +202,7 @@
|
|
|
201
202
|
</div>
|
|
202
203
|
<div class="range-block-range-and-counter">
|
|
203
204
|
<div class="range-block-range">
|
|
204
|
-
<input type="range" id="max_context" name="volume" min="512" max="
|
|
205
|
+
<input type="range" id="max_context" name="volume" min="512" max="4096" step="1">
|
|
205
206
|
</div>
|
|
206
207
|
<div class="range-block-counter" data-randomization-disabled="true">
|
|
207
208
|
<div contenteditable="true" data-for="max_context" id="max_context_counter">
|
|
@@ -217,10 +218,9 @@
|
|
|
217
218
|
<span data-i18n="unlocked">Unlocked</span>
|
|
218
219
|
</label>
|
|
219
220
|
<div id="max_context_unlocked_warning">
|
|
220
|
-
<b class="neutral_warning" data-i18n="ATTENTION!">ATTENTION!</b>
|
|
221
221
|
<span data-i18n="only select modls support context sizes greater than 2048 tokens. proceed only is you know you're doing">
|
|
222
222
|
Only select models support context sizes greater than 2048 tokens.
|
|
223
|
-
|
|
223
|
+
Increase only if you know what you're doing.
|
|
224
224
|
</span>
|
|
225
225
|
</div>
|
|
226
226
|
</div>
|
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
</div>
|
|
267
267
|
<div class="range-block-range-and-counter">
|
|
268
268
|
<div class="range-block-range">
|
|
269
|
-
<input type="range" id="rep_pen_range" name="volume" min="0" max="
|
|
269
|
+
<input type="range" id="rep_pen_range" name="volume" min="0" max="4096" step="1">
|
|
270
270
|
</div>
|
|
271
271
|
<div class="range-block-counter">
|
|
272
272
|
<div contenteditable="true" data-for="rep_pen_range" id="rep_pen_range_counter">
|
|
@@ -441,6 +441,21 @@
|
|
|
441
441
|
</div>
|
|
442
442
|
</div>
|
|
443
443
|
</div>
|
|
444
|
+
<div class="range-block">
|
|
445
|
+
<div class="range-block-title" data-i18n="rep.pen range">
|
|
446
|
+
Rep. Pen. Range
|
|
447
|
+
</div>
|
|
448
|
+
<div class="range-block-range-and-counter">
|
|
449
|
+
<div class="range-block-range">
|
|
450
|
+
<input type="range" id="rep_pen_range_textgenerationwebui" name="volume" min="0" max="4096" step="1">
|
|
451
|
+
</div>
|
|
452
|
+
<div class="range-block-counter">
|
|
453
|
+
<div contenteditable="true" data-for="rep_pen_range_textgenerationwebui" id="rep_pen_range_counter_textgenerationwebui">
|
|
454
|
+
select
|
|
455
|
+
</div>
|
|
456
|
+
</div>
|
|
457
|
+
</div>
|
|
458
|
+
</div>
|
|
444
459
|
<div class="range-block">
|
|
445
460
|
<div class="range-block-title" data-i18n="Encoder Rep. Pen.">
|
|
446
461
|
Encoder Rep. Pen.
|
|
@@ -1423,7 +1438,9 @@
|
|
|
1423
1438
|
<form id="openai_form" data-source="openai" action="javascript:void(null);" method="post" enctype="multipart/form-data">
|
|
1424
1439
|
<h4><span data-i18n="OpenAI API key">OpenAI API key</span></h4>
|
|
1425
1440
|
<div>
|
|
1426
|
-
<a id="openai_api_usage" href="
|
|
1441
|
+
<a id="openai_api_usage" href="https://platform.openai.com/account/usage" target="_blank">
|
|
1442
|
+
<span data-i18n="View API Usage Metrics">View API Usage Metrics</span>
|
|
1443
|
+
</a>
|
|
1427
1444
|
</div>
|
|
1428
1445
|
<span>
|
|
1429
1446
|
<ol>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Llama 2",
|
|
3
|
+
"system_prompt": "Write {{user}}'s next reply in this fictional roleplay with {{char}}.\n<</SYS>>\n",
|
|
4
|
+
"system_sequence": "[INST] <<SYS>>\n",
|
|
5
|
+
"stop_sequence": "",
|
|
6
|
+
"input_sequence": "[INST]",
|
|
7
|
+
"output_sequence": "[/INST]",
|
|
8
|
+
"separator_sequence": "\n",
|
|
9
|
+
"wrap": false
|
|
10
|
+
}
|
package/public/script.js
CHANGED
|
@@ -1527,7 +1527,6 @@ function scrollChatToBottom() {
|
|
|
1527
1527
|
function substituteParams(content, _name1, _name2, _original) {
|
|
1528
1528
|
_name1 = _name1 ?? name1;
|
|
1529
1529
|
_name2 = _name2 ?? name2;
|
|
1530
|
-
_original = _original || '';
|
|
1531
1530
|
|
|
1532
1531
|
if (!content) {
|
|
1533
1532
|
return '';
|
|
@@ -1536,7 +1535,9 @@ function substituteParams(content, _name1, _name2, _original) {
|
|
|
1536
1535
|
// Replace {{original}} with the original message
|
|
1537
1536
|
// Note: only replace the first instance of {{original}}
|
|
1538
1537
|
// This will hopefully prevent the abuse
|
|
1539
|
-
|
|
1538
|
+
if (typeof _original === 'string') {
|
|
1539
|
+
content = content.replace(/{{original}}/i, _original);
|
|
1540
|
+
}
|
|
1540
1541
|
content = content.replace(/{{input}}/gi, $('#send_textarea').val());
|
|
1541
1542
|
content = content.replace(/{{user}}/gi, _name1);
|
|
1542
1543
|
content = content.replace(/{{char}}/gi, _name2);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* jQuery UI Touch Punch 0.2.3
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2011–2014, Dave Furfero
|
|
5
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
6
|
+
*
|
|
7
|
+
* Depends:
|
|
8
|
+
* jquery.ui.widget.js
|
|
9
|
+
* jquery.ui.mouse.js
|
|
10
|
+
*/
|
|
11
|
+
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
|
package/public/scripts/openai.js
CHANGED
|
@@ -695,12 +695,10 @@ function saveModelList(data) {
|
|
|
695
695
|
$('#model_openrouter_select').empty();
|
|
696
696
|
$('#model_openrouter_select').append($('<option>', { value: openrouter_website_model, text: 'Use OpenRouter website setting' }));
|
|
697
697
|
model_list.forEach((model) => {
|
|
698
|
-
const selected = model.id == oai_settings.openrouter_model;
|
|
699
698
|
$('#model_openrouter_select').append(
|
|
700
699
|
$('<option>', {
|
|
701
700
|
value: model.id,
|
|
702
701
|
text: model.id,
|
|
703
|
-
selected: selected,
|
|
704
702
|
}));
|
|
705
703
|
});
|
|
706
704
|
$('#model_openrouter_select').val(oai_settings.openrouter_model).trigger('change');
|
|
@@ -709,19 +707,16 @@ function saveModelList(data) {
|
|
|
709
707
|
if (oai_settings.chat_completion_source == chat_completion_sources.OPENAI) {
|
|
710
708
|
$('#openai_external_category').empty();
|
|
711
709
|
model_list.forEach((model) => {
|
|
712
|
-
const selected = model.id == oai_settings.openai_model && oai_settings.show_external_models;
|
|
713
710
|
$('#openai_external_category').append(
|
|
714
711
|
$('<option>', {
|
|
715
712
|
value: model.id,
|
|
716
713
|
text: model.id,
|
|
717
|
-
selected: selected,
|
|
718
714
|
}));
|
|
719
715
|
});
|
|
720
716
|
// If the selected model is not in the list, revert to default
|
|
721
|
-
if (oai_settings.show_external_models
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
$('#model_openai_select').val(default_settings.openai_model).trigger('change');
|
|
717
|
+
if (oai_settings.show_external_models) {
|
|
718
|
+
const model = model_list.findIndex((model) => model.id == oai_settings.openai_model) !== -1 ? oai_settings.openai_model : default_settings.openai_model;
|
|
719
|
+
$('#model_openai_select').val(model).trigger('change');
|
|
725
720
|
}
|
|
726
721
|
}
|
|
727
722
|
}
|
|
@@ -1354,26 +1349,6 @@ async function saveOpenAIPreset(name, settings) {
|
|
|
1354
1349
|
}
|
|
1355
1350
|
}
|
|
1356
1351
|
|
|
1357
|
-
async function showApiKeyUsage() {
|
|
1358
|
-
try {
|
|
1359
|
-
const response = await fetch('/openai_usage', {
|
|
1360
|
-
method: 'POST',
|
|
1361
|
-
headers: getRequestHeaders(),
|
|
1362
|
-
});
|
|
1363
|
-
|
|
1364
|
-
if (response.ok) {
|
|
1365
|
-
const data = await response.json();
|
|
1366
|
-
const text = `<h3>Total usage this month: $${Number(data.total_usage / 100).toFixed(2)}</h3>
|
|
1367
|
-
<a href="https://platform.openai.com/account/usage" target="_blank">Learn more (OpenAI platform website)</a>`;
|
|
1368
|
-
callPopup(text, 'text');
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
catch (err) {
|
|
1372
|
-
console.error(err);
|
|
1373
|
-
toastr.error('Invalid API key');
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
1352
|
function onLogitBiasPresetChange() {
|
|
1378
1353
|
const value = $('#openai_logit_bias_preset').find(':selected').val();
|
|
1379
1354
|
const preset = oai_settings.bias_presets[value];
|
|
@@ -2231,7 +2206,6 @@ $(document).ready(function () {
|
|
|
2231
2206
|
$("#settings_perset_openai").on("change", onSettingsPresetChange);
|
|
2232
2207
|
$("#new_oai_preset").on("click", onNewPresetClick);
|
|
2233
2208
|
$("#delete_oai_preset").on("click", onDeletePresetClick);
|
|
2234
|
-
$("#openai_api_usage").on("click", showApiKeyUsage);
|
|
2235
2209
|
$("#openai_logit_bias_preset").on("change", onLogitBiasPresetChange);
|
|
2236
2210
|
$("#openai_logit_bias_new_preset").on("click", createNewLogitBiasPreset);
|
|
2237
2211
|
$("#openai_logit_bias_new_entry").on("click", createNewLogitBiasEntry);
|
package/public/scripts/stats.js
CHANGED
|
@@ -256,6 +256,19 @@ async function statMesProcess(line, type, characters, this_chid, oldMesssage) {
|
|
|
256
256
|
|
|
257
257
|
let stat = charStats[characters[this_chid].avatar];
|
|
258
258
|
|
|
259
|
+
if (!stat) {
|
|
260
|
+
stat = {
|
|
261
|
+
total_gen_time: 0,
|
|
262
|
+
user_word_count: 0,
|
|
263
|
+
non_user_msg_count: 0,
|
|
264
|
+
user_msg_count: 0,
|
|
265
|
+
non_user_msg_count: 0,
|
|
266
|
+
total_swipe_count: 0,
|
|
267
|
+
date_first_chat: Date.now(),
|
|
268
|
+
date_last_chat: Date.now(),
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
|
|
259
272
|
stat.total_gen_time += calculateGenTime(
|
|
260
273
|
line.gen_started,
|
|
261
274
|
line.gen_finished
|
|
@@ -21,6 +21,7 @@ let textgenerationwebui_settings = {
|
|
|
21
21
|
eta_cutoff: 0,
|
|
22
22
|
typical_p: 1,
|
|
23
23
|
rep_pen: 1.2,
|
|
24
|
+
rep_pen_range: 0,
|
|
24
25
|
no_repeat_ngram_size: 0,
|
|
25
26
|
penalty_alpha: 0,
|
|
26
27
|
num_beams: 1,
|
|
@@ -49,6 +50,7 @@ let textgenerationwebui_preset_names = [];
|
|
|
49
50
|
const setting_names = [
|
|
50
51
|
"temp",
|
|
51
52
|
"rep_pen",
|
|
53
|
+
"rep_pen_range",
|
|
52
54
|
"no_repeat_ngram_size",
|
|
53
55
|
"top_k",
|
|
54
56
|
"top_p",
|
|
@@ -212,6 +214,7 @@ export function getTextGenGenerationData(finalPromt, this_amount_gen, isImperson
|
|
|
212
214
|
'top_p': textgenerationwebui_settings.top_p,
|
|
213
215
|
'typical_p': textgenerationwebui_settings.typical_p,
|
|
214
216
|
'repetition_penalty': textgenerationwebui_settings.rep_pen,
|
|
217
|
+
'repetition_penalty_range': textgenerationwebui_settings.rep_pen_range,
|
|
215
218
|
'encoder_repetition_penalty': textgenerationwebui_settings.encoder_rep_pen,
|
|
216
219
|
'top_k': textgenerationwebui_settings.top_k,
|
|
217
220
|
'min_length': textgenerationwebui_settings.min_length,
|
package/server.js
CHANGED
|
@@ -2927,7 +2927,8 @@ app.post("/openai_bias", jsonParser, async function (request, response) {
|
|
|
2927
2927
|
return response.send(result);
|
|
2928
2928
|
});
|
|
2929
2929
|
|
|
2930
|
-
//
|
|
2930
|
+
// TODO: Dead code, consider deleting. Users will get redirected to OpenAI site instead.
|
|
2931
|
+
// 'Your request to GET /v1/dashboard/billing/usage must be made with a session key (that is, it can only be made from the browser). You made it with the following key type: secret.'
|
|
2931
2932
|
app.post("/openai_usage", jsonParser, async function (request, response) {
|
|
2932
2933
|
if (!request.body) return response.sendStatus(400);
|
|
2933
2934
|
const key = readSecret(SECRET_KEYS.OPENAI);
|
|
@@ -2958,7 +2959,8 @@ app.post("/openai_usage", jsonParser, async function (request, response) {
|
|
|
2958
2959
|
);
|
|
2959
2960
|
return response.send(res);
|
|
2960
2961
|
}
|
|
2961
|
-
catch {
|
|
2962
|
+
catch (error) {
|
|
2963
|
+
console.log(error);
|
|
2962
2964
|
return response.sendStatus(400);
|
|
2963
2965
|
}
|
|
2964
2966
|
});
|