Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef3c8a19fe | ||
|
|
732761a427 | ||
|
|
212e98302a | ||
|
|
ed366b15ca | ||
|
|
d7b895b92d | ||
|
|
0d6346180f | ||
|
|
433ddf5901 | ||
|
|
8e73882c9b | ||
|
|
e2f1f4a57a | ||
|
|
7205255d18 | ||
|
|
bc6e46bac8 | ||
|
|
374e931b2e | ||
|
|
f28e7cf47c | ||
|
|
8d5fbbe2bc | ||
|
|
2e6e8623f3 | ||
|
|
18462a632c |
+2
-2
@@ -144,8 +144,8 @@ An easy-to-follow guide with pretty pictures:
|
||||
5. Open a Command Prompt inside that folder by clicking in the 'Address Bar' at the top, typing `cmd`, and pressing Enter.
|
||||
6. Once the black box (Command Prompt) pops up, type ONE of the following into it and press Enter:
|
||||
|
||||
* for Main Branch: `git clone https://github.com/SillyTavern/SillyTavern -b main`
|
||||
* for Dev Branch: `git clone https://github.com/SillyTavern/SillyTavern -b dev`
|
||||
* for Release Branch: `git clone https://github.com/SillyTavern/SillyTavern -b release`
|
||||
* for Staging Branch: `git clone https://github.com/SillyTavern/SillyTavern -b staging`
|
||||
|
||||
7. Once everything is cloned, double-click `Start.bat` to make NodeJS install its requirements.
|
||||
8. The server will then start, and SillyTavern will pop up in your browser.
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "sillytavern",
|
||||
"version": "1.9.1",
|
||||
"version": "1.9.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "sillytavern",
|
||||
"version": "1.9.1",
|
||||
"version": "1.9.2",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@dqbd/tiktoken": "^1.0.2",
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/SillyTavern/SillyTavern.git"
|
||||
},
|
||||
"version": "1.9.1",
|
||||
"version": "1.9.2",
|
||||
"scripts": {
|
||||
"start": "node server.js",
|
||||
"pkg": "pkg --compress Gzip --no-bytecode --public ."
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.02,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 4.5,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 2,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 10,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.01,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0.6,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.2,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 1.49,
|
||||
"eta_cutoff": 10.42,
|
||||
"rep_pen": 1.17,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.1,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.1,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.18,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.18,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.15,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"tfs": 1,
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.05,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.15,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.05,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.15,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.15,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.1,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"top_a": 0,
|
||||
"tfs": 1,
|
||||
"rep_pen": 1.1,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.07,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.15,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.09,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.15,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 10.78,
|
||||
"rep_pen": 1.21,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"epsilon_cutoff": 0,
|
||||
"eta_cutoff": 0,
|
||||
"rep_pen": 1.19,
|
||||
"rep_pen_range": 0,
|
||||
"no_repeat_ngram_size": 0,
|
||||
"penalty_alpha": 0,
|
||||
"num_beams": 1,
|
||||
|
||||
+22
-5
@@ -26,6 +26,7 @@
|
||||
<script src="scripts/jquery-ui.min.js"></script>
|
||||
<script src="scripts/jquery.transit.min.js"></script>
|
||||
<script src="scripts/jquery-cookie-1.4.1.min.js"></script>
|
||||
<script src="scripts/jquery.ui.touch-punch.min.js"></script>
|
||||
<script src="scripts/showdown.min.js"></script>
|
||||
<script src="scripts/showdown-katex.min.js"></script>
|
||||
<script src="scripts/popper.js"></script>
|
||||
@@ -201,7 +202,7 @@
|
||||
</div>
|
||||
<div class="range-block-range-and-counter">
|
||||
<div class="range-block-range">
|
||||
<input type="range" id="max_context" name="volume" min="512" max="2048" step="1">
|
||||
<input type="range" id="max_context" name="volume" min="512" max="4096" step="1">
|
||||
</div>
|
||||
<div class="range-block-counter" data-randomization-disabled="true">
|
||||
<div contenteditable="true" data-for="max_context" id="max_context_counter">
|
||||
@@ -217,10 +218,9 @@
|
||||
<span data-i18n="unlocked">Unlocked</span>
|
||||
</label>
|
||||
<div id="max_context_unlocked_warning">
|
||||
<b class="neutral_warning" data-i18n="ATTENTION!">ATTENTION!</b>
|
||||
<span data-i18n="only select modls support context sizes greater than 2048 tokens. proceed only is you know you're doing">
|
||||
Only select models support context sizes greater than 2048 tokens.
|
||||
Proceed only if you know what you're doing.
|
||||
Increase only if you know what you're doing.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -266,7 +266,7 @@
|
||||
</div>
|
||||
<div class="range-block-range-and-counter">
|
||||
<div class="range-block-range">
|
||||
<input type="range" id="rep_pen_range" name="volume" min="0" max="2048" step="1">
|
||||
<input type="range" id="rep_pen_range" name="volume" min="0" max="4096" step="1">
|
||||
</div>
|
||||
<div class="range-block-counter">
|
||||
<div contenteditable="true" data-for="rep_pen_range" id="rep_pen_range_counter">
|
||||
@@ -441,6 +441,21 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="range-block">
|
||||
<div class="range-block-title" data-i18n="rep.pen range">
|
||||
Rep. Pen. Range
|
||||
</div>
|
||||
<div class="range-block-range-and-counter">
|
||||
<div class="range-block-range">
|
||||
<input type="range" id="rep_pen_range_textgenerationwebui" name="volume" min="0" max="4096" step="1">
|
||||
</div>
|
||||
<div class="range-block-counter">
|
||||
<div contenteditable="true" data-for="rep_pen_range_textgenerationwebui" id="rep_pen_range_counter_textgenerationwebui">
|
||||
select
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="range-block">
|
||||
<div class="range-block-title" data-i18n="Encoder Rep. Pen.">
|
||||
Encoder Rep. Pen.
|
||||
@@ -1423,7 +1438,9 @@
|
||||
<form id="openai_form" data-source="openai" action="javascript:void(null);" method="post" enctype="multipart/form-data">
|
||||
<h4><span data-i18n="OpenAI API key">OpenAI API key</span></h4>
|
||||
<div>
|
||||
<a id="openai_api_usage" href="javascript:void(0);"><span data-i18n="View API Usage Metrics">View API Usage Metrics</span></a>
|
||||
<a id="openai_api_usage" href="https://platform.openai.com/account/usage" target="_blank">
|
||||
<span data-i18n="View API Usage Metrics">View API Usage Metrics</span>
|
||||
</a>
|
||||
</div>
|
||||
<span>
|
||||
<ol>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "Llama 2",
|
||||
"system_prompt": "Write {{user}}'s next reply in this fictional roleplay with {{char}}.\n<</SYS>>\n",
|
||||
"system_sequence": "[INST] <<SYS>>\n",
|
||||
"stop_sequence": "",
|
||||
"input_sequence": "[INST]",
|
||||
"output_sequence": "[/INST]",
|
||||
"separator_sequence": "\n",
|
||||
"wrap": false
|
||||
}
|
||||
+3
-2
@@ -1527,7 +1527,6 @@ function scrollChatToBottom() {
|
||||
function substituteParams(content, _name1, _name2, _original) {
|
||||
_name1 = _name1 ?? name1;
|
||||
_name2 = _name2 ?? name2;
|
||||
_original = _original || '';
|
||||
|
||||
if (!content) {
|
||||
return '';
|
||||
@@ -1536,7 +1535,9 @@ function substituteParams(content, _name1, _name2, _original) {
|
||||
// Replace {{original}} with the original message
|
||||
// Note: only replace the first instance of {{original}}
|
||||
// This will hopefully prevent the abuse
|
||||
content = content.replace(/{{original}}/i, _original);
|
||||
if (typeof _original === 'string') {
|
||||
content = content.replace(/{{original}}/i, _original);
|
||||
}
|
||||
content = content.replace(/{{input}}/gi, $('#send_textarea').val());
|
||||
content = content.replace(/{{user}}/gi, _name1);
|
||||
content = content.replace(/{{char}}/gi, _name2);
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
/*!
|
||||
* jQuery UI Touch Punch 0.2.3
|
||||
*
|
||||
* Copyright 2011–2014, Dave Furfero
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.widget.js
|
||||
* jquery.ui.mouse.js
|
||||
*/
|
||||
!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);
|
||||
@@ -695,12 +695,10 @@ function saveModelList(data) {
|
||||
$('#model_openrouter_select').empty();
|
||||
$('#model_openrouter_select').append($('<option>', { value: openrouter_website_model, text: 'Use OpenRouter website setting' }));
|
||||
model_list.forEach((model) => {
|
||||
const selected = model.id == oai_settings.openrouter_model;
|
||||
$('#model_openrouter_select').append(
|
||||
$('<option>', {
|
||||
value: model.id,
|
||||
text: model.id,
|
||||
selected: selected,
|
||||
}));
|
||||
});
|
||||
$('#model_openrouter_select').val(oai_settings.openrouter_model).trigger('change');
|
||||
@@ -709,19 +707,16 @@ function saveModelList(data) {
|
||||
if (oai_settings.chat_completion_source == chat_completion_sources.OPENAI) {
|
||||
$('#openai_external_category').empty();
|
||||
model_list.forEach((model) => {
|
||||
const selected = model.id == oai_settings.openai_model && oai_settings.show_external_models;
|
||||
$('#openai_external_category').append(
|
||||
$('<option>', {
|
||||
value: model.id,
|
||||
text: model.id,
|
||||
selected: selected,
|
||||
}));
|
||||
});
|
||||
// If the selected model is not in the list, revert to default
|
||||
if (oai_settings.show_external_models && model_list.find((model) => model.id == oai_settings.openai_model)) {
|
||||
$('#model_openai_select').val(oai_settings.openai_model).trigger('change');
|
||||
} else {
|
||||
$('#model_openai_select').val(default_settings.openai_model).trigger('change');
|
||||
if (oai_settings.show_external_models) {
|
||||
const model = model_list.findIndex((model) => model.id == oai_settings.openai_model) !== -1 ? oai_settings.openai_model : default_settings.openai_model;
|
||||
$('#model_openai_select').val(model).trigger('change');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1354,26 +1349,6 @@ async function saveOpenAIPreset(name, settings) {
|
||||
}
|
||||
}
|
||||
|
||||
async function showApiKeyUsage() {
|
||||
try {
|
||||
const response = await fetch('/openai_usage', {
|
||||
method: 'POST',
|
||||
headers: getRequestHeaders(),
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
const text = `<h3>Total usage this month: $${Number(data.total_usage / 100).toFixed(2)}</h3>
|
||||
<a href="https://platform.openai.com/account/usage" target="_blank">Learn more (OpenAI platform website)</a>`;
|
||||
callPopup(text, 'text');
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
toastr.error('Invalid API key');
|
||||
}
|
||||
}
|
||||
|
||||
function onLogitBiasPresetChange() {
|
||||
const value = $('#openai_logit_bias_preset').find(':selected').val();
|
||||
const preset = oai_settings.bias_presets[value];
|
||||
@@ -2231,7 +2206,6 @@ $(document).ready(function () {
|
||||
$("#settings_perset_openai").on("change", onSettingsPresetChange);
|
||||
$("#new_oai_preset").on("click", onNewPresetClick);
|
||||
$("#delete_oai_preset").on("click", onDeletePresetClick);
|
||||
$("#openai_api_usage").on("click", showApiKeyUsage);
|
||||
$("#openai_logit_bias_preset").on("change", onLogitBiasPresetChange);
|
||||
$("#openai_logit_bias_new_preset").on("click", createNewLogitBiasPreset);
|
||||
$("#openai_logit_bias_new_entry").on("click", createNewLogitBiasEntry);
|
||||
|
||||
@@ -43,7 +43,7 @@ export {
|
||||
send_on_enter_options,
|
||||
};
|
||||
|
||||
const MAX_CONTEXT_DEFAULT = 2048;
|
||||
const MAX_CONTEXT_DEFAULT = 4096;
|
||||
const MAX_CONTEXT_UNLOCKED = 65536;
|
||||
|
||||
const avatar_styles = {
|
||||
|
||||
@@ -256,6 +256,19 @@ async function statMesProcess(line, type, characters, this_chid, oldMesssage) {
|
||||
|
||||
let stat = charStats[characters[this_chid].avatar];
|
||||
|
||||
if (!stat) {
|
||||
stat = {
|
||||
total_gen_time: 0,
|
||||
user_word_count: 0,
|
||||
non_user_msg_count: 0,
|
||||
user_msg_count: 0,
|
||||
non_user_msg_count: 0,
|
||||
total_swipe_count: 0,
|
||||
date_first_chat: Date.now(),
|
||||
date_last_chat: Date.now(),
|
||||
};
|
||||
}
|
||||
|
||||
stat.total_gen_time += calculateGenTime(
|
||||
line.gen_started,
|
||||
line.gen_finished
|
||||
|
||||
@@ -21,6 +21,7 @@ let textgenerationwebui_settings = {
|
||||
eta_cutoff: 0,
|
||||
typical_p: 1,
|
||||
rep_pen: 1.2,
|
||||
rep_pen_range: 0,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
@@ -49,6 +50,7 @@ let textgenerationwebui_preset_names = [];
|
||||
const setting_names = [
|
||||
"temp",
|
||||
"rep_pen",
|
||||
"rep_pen_range",
|
||||
"no_repeat_ngram_size",
|
||||
"top_k",
|
||||
"top_p",
|
||||
@@ -212,6 +214,7 @@ export function getTextGenGenerationData(finalPromt, this_amount_gen, isImperson
|
||||
'top_p': textgenerationwebui_settings.top_p,
|
||||
'typical_p': textgenerationwebui_settings.typical_p,
|
||||
'repetition_penalty': textgenerationwebui_settings.rep_pen,
|
||||
'repetition_penalty_range': textgenerationwebui_settings.rep_pen_range,
|
||||
'encoder_repetition_penalty': textgenerationwebui_settings.encoder_rep_pen,
|
||||
'top_k': textgenerationwebui_settings.top_k,
|
||||
'min_length': textgenerationwebui_settings.min_length,
|
||||
|
||||
@@ -2927,7 +2927,8 @@ app.post("/openai_bias", jsonParser, async function (request, response) {
|
||||
return response.send(result);
|
||||
});
|
||||
|
||||
// Shamelessly stolen from Agnai
|
||||
// TODO: Dead code, consider deleting. Users will get redirected to OpenAI site instead.
|
||||
// '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.'
|
||||
app.post("/openai_usage", jsonParser, async function (request, response) {
|
||||
if (!request.body) return response.sendStatus(400);
|
||||
const key = readSecret(SECRET_KEYS.OPENAI);
|
||||
@@ -2958,7 +2959,8 @@ app.post("/openai_usage", jsonParser, async function (request, response) {
|
||||
);
|
||||
return response.send(res);
|
||||
}
|
||||
catch {
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
return response.sendStatus(400);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user