Compare commits

..
19 Commits
Author SHA1 Message Date
Cohee 3b99f7839b Bump package version 2023-06-29 01:10:04 +03:00
Cohee 7c6c2ee8b6 Fix Poe 2023-06-29 01:09:34 +03:00
Cohee c873a6b04c Fix npm audit. 2023-06-23 13:53:37 +03:00
Cohee d4332aa7ec No audit to npm install 2023-06-22 20:50:01 +03:00
Cohee 267db5166f Merge pull request #550 from v86861062/main
start.sh: Fixed the commands
2023-06-22 12:41:28 +03:00
v86861062 0e45450912 start.sh: Fixed the commands
Signed-off-by: v86861062 <v86861062@gmail.com>
2023-06-22 12:19:35 +08:00
Cohee a37922ad59 Merge pull request #544 from BlipRanger/patch-3 2023-06-21 09:57:44 +03:00
BlipRanger e4a6bdb389 Update readme.md
Add BlipRanger
2023-06-20 20:33:46 -04:00
RossAscends a43f99b492 new base themes 2023-06-18 23:57:30 +09:00
Cohee c890da2877 Fix server crash when KoboldCpp server goes offline and stop is clicked 2023-06-16 14:11:52 +03:00
Cohee bec6227aaf Merge branch 'main' of https://github.com/SillyLossy/TavernAI 2023-06-16 12:55:08 +03:00
Cohee 6a2a0efc84 Don't run streaming with Kobold on quiet gens #504 2023-06-16 12:55:02 +03:00
Cohee b09ea054df Bump package version 2023-06-16 00:24:41 +03:00
Cohee 024784e0b0 Fix oobabooga homunculus mode 2023-06-16 00:22:27 +03:00
Cohee 329158349f Remove debug statement 2023-06-16 00:08:52 +03:00
Cohee 62d5f20590 Don't stack suggested replies when using impersonate on Poe 2023-06-15 20:05:53 +03:00
Cohee e420c96e77 Fix mobile audio playback stopping on swiping 2023-06-15 19:31:18 +03:00
Cohee 7af5a6ee5d Fix broken preset file 2023-06-15 19:26:25 +03:00
Cohee e91cbe009f Correctly clamp max_context value on saving a chat completion preset 2023-06-15 18:32:56 +03:00
15 changed files with 86 additions and 61 deletions
+1
View File
@@ -293,6 +293,7 @@ GNU Affero General Public License for more details.**
* Cohee's modifications and derived code: AGPL v3
* RossAscends' additions: AGPL v3
* Portions of CncAnon's TavernAITurbo mod: Unknown license
* BlipRanger's miscellaneous UI & extension modifications (<https://github.com/BlipRanger>)
* Waifu mode inspired by the work of PepperTaco (<https://github.com/peppertaco/Tavern/>)
* Thanks Pygmalion University for being awesome testers and suggesting cool features!
* Thanks oobabooga for compiling presets for TextGen
+2 -2
View File
@@ -1,5 +1,5 @@
pushd %~dp0
call npm install
call npm install --no-audit
node server.js
pause
popd
popd
+5 -5
View File
@@ -1,12 +1,12 @@
{
"name": "sillytavern",
"version": "1.7.0",
"version": "1.7.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sillytavern",
"version": "1.7.0",
"version": "1.7.2",
"license": "AGPL-3.0",
"dependencies": {
"@dqbd/tiktoken": "^1.0.2",
@@ -3035,9 +3035,9 @@
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
},
"node_modules/semver": {
"version": "7.5.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz",
"integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==",
"version": "7.5.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz",
"integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
+1 -1
View File
@@ -48,7 +48,7 @@
"type": "git",
"url": "https://github.com/SillyTavern/SillyTavern.git"
},
"version": "1.7.0",
"version": "1.7.2",
"scripts": {
"start": "node server.js",
"pkg": "pkg --compress Gzip --no-bytecode --public ."
@@ -1,5 +1,5 @@
{
"order": [1, 0, 3]
"order": [1, 0, 3],
"temperature": 1.07,
"max_length": 60,
"min_length": 60,
@@ -14,4 +14,4 @@
"repetition_penalty_frequency": 0,
"repetition_penalty_presence": 0,
"max_context":2048
}
}
+1 -1
View File
@@ -2279,7 +2279,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
if (preset_settings != 'gui') {
const maxContext = (adjustedParams && horde_settings.auto_adjust_context_length) ? adjustedParams.maxContextLength : max_context;
generate_data = getKoboldGenerationData(finalPromt, this_settings, this_amount_gen, maxContext, isImpersonate);
generate_data = getKoboldGenerationData(finalPromt, this_settings, this_amount_gen, maxContext, isImpersonate, type);
}
}
else if (main_api == 'textgenerationwebui') {
+1 -24
View File
@@ -173,7 +173,7 @@ function resetTtsPlayback() {
// Reset audio element
audioElement.currentTime = 0;
audioElement.src = '/sounds/silence.mp3';
audioElement.src = '';
// Clear any queue items
ttsJobQueue.splice(0, ttsJobQueue.length);
@@ -412,7 +412,6 @@ async function processTtsQueue() {
// Remove character name from start of the line if power user setting is disabled
if (char && !power_user.allow_name2_display) {
debugger;
const escapedChar = escapeRegex(char);
text = text.replace(new RegExp(`^${escapedChar}:`, 'gm'), '');
}
@@ -704,26 +703,4 @@ $(document).ready(function () {
const wrapper = new ModuleWorkerWrapper(moduleWorker);
setInterval(wrapper.update.bind(wrapper), UPDATE_INTERVAL) // Init depends on all the things
eventSource.on(event_types.MESSAGE_SWIPED, resetTtsPlayback);
// Mobiles need to "activate" the Audio element with click before it can be played
if (isMobile()) {
console.debug('Activating mobile audio element on first click');
let audioActivated = false;
// Play silence on first click
$(document).on('click touchend', function () {
// Prevent multiple activations
if (audioActivated) {
return;
}
console.debug('Activating audio element...');
audioActivated = true;
audioElement.src = '/sounds/silence.mp3';
// Reset volume to 1
audioElement.onended = function () {
console.debug('Audio element activated');
};
});
}
})
+3 -3
View File
@@ -68,7 +68,7 @@ function loadKoboldSettings(preset) {
}
}
function getKoboldGenerationData(finalPromt, this_settings, this_amount_gen, this_max_context, isImpersonate) {
function getKoboldGenerationData(finalPromt, this_settings, this_amount_gen, this_max_context, isImpersonate, type) {
let generate_data = {
prompt: finalPromt,
gui_settings: false,
@@ -94,7 +94,7 @@ function getKoboldGenerationData(finalPromt, this_settings, this_amount_gen, thi
use_world_info: false,
singleline: kai_settings.single_line,
stop_sequence: kai_settings.use_stop_sequence ? getStoppingStrings(isImpersonate, false) : undefined,
streaming: kai_settings.streaming_kobold && kai_settings.can_use_streaming,
streaming: kai_settings.streaming_kobold && kai_settings.can_use_streaming && type !== 'quiet',
can_abort: kai_settings.can_use_streaming,
};
return generate_data;
@@ -213,7 +213,7 @@ function canUseKoboldStopSequence(version) {
}
function canUseKoboldStreaming(koboldVersion) {
if (koboldVersion.result == 'KoboldCpp') {
if (koboldVersion && koboldVersion.result == 'KoboldCpp') {
return (koboldVersion.version || '0.0').localeCompare(MIN_STREAMING_KCPPVERSION, undefined, { numeric: true, sensitivity: 'base' }) > -1;
} else return false;
}
+5 -4
View File
@@ -1490,10 +1490,11 @@ function onModelChange() {
}
else {
$('#openai_max_context').attr('max', claude_max);
oai_settings.openai_max_context = Math.max(oai_settings.openai_max_context, claude_max);
$('#openai_max_context').val(oai_settings.openai_max_context).trigger('input');
}
oai_settings.openai_max_context = Math.min(oai_settings.openai_max_context, Number($('#openai_max_context').attr('max')));
$('#openai_max_context').val(oai_settings.openai_max_context).trigger('input');
$('#openai_reverse_proxy').attr('placeholder', 'https://api.anthropic.com/v1');
oai_settings.temp_openai = Math.min(claude_max_temp, oai_settings.temp_openai);
@@ -1527,7 +1528,7 @@ function onModelChange() {
$('#openai_max_context').attr('max', gpt3_max);
}
oai_settings.openai_max_context = Math.max(Number($('#openai_max_context').val()), oai_settings.openai_max_context);
oai_settings.openai_max_context = Math.min(Number($('#openai_max_context').attr('max')), oai_settings.openai_max_context);
$('#openai_max_context').val(oai_settings.openai_max_context).trigger('input');
if (value.includes('claude')) {
@@ -1557,7 +1558,7 @@ function onModelChange() {
$('#openai_max_context').attr('max', gpt3_max);
}
oai_settings.openai_max_context = Math.max(oai_settings.openai_max_context, Number($('#openai_max_context').attr('max')));
oai_settings.openai_max_context = Math.min(oai_settings.openai_max_context, Number($('#openai_max_context').attr('max')));
$('#openai_max_context').val(oai_settings.openai_max_context).trigger('input');
$('#openai_reverse_proxy').attr('placeholder', 'https://api.openai.com/v1');
+5 -4
View File
@@ -263,24 +263,25 @@ async function generatePoe(type, finalPrompt, signal) {
}
const isQuiet = type === 'quiet';
const isImpersonate = type === 'impersonate';
let reply = '';
if (max_context > POE_TOKEN_LENGTH && poe_settings.bot !== 'a2_100k') {
console.debug('Prompt is too long, sending in chunks');
const result = await sendChunkedMessage(finalPrompt, !isQuiet, signal)
const result = await sendChunkedMessage(finalPrompt, !isQuiet, !isQuiet && !isImpersonate, signal)
reply = result.reply;
messages_to_purge = result.chunks + 1; // +1 for the reply
}
else {
console.debug('Sending prompt in one message');
reply = await sendMessage(finalPrompt, !isQuiet, !isQuiet, signal);
reply = await sendMessage(finalPrompt, !isQuiet, !isQuiet && !isImpersonate, signal);
messages_to_purge = 2; // prompt and the reply
}
return reply;
}
async function sendChunkedMessage(finalPrompt, withStreaming, signal) {
async function sendChunkedMessage(finalPrompt, withStreaming, withSuggestions, signal) {
const fastReplyPrompt = '\n[Reply to this message with a full stop only]';
const promptChunks = splitRecursive(finalPrompt, CHUNKED_PROMPT_LENGTH - fastReplyPrompt.length);
console.debug(`Splitting prompt into ${promptChunks.length} chunks`, promptChunks);
@@ -291,7 +292,7 @@ async function sendChunkedMessage(finalPrompt, withStreaming, signal) {
console.debug(`Sending chunk ${i + 1}/${promptChunks.length}: ${promptChunk}`);
if (i == promptChunks.length - 1) {
// Extract reply of the last chunk
reply = await sendMessage(promptChunk, withStreaming, true, signal);
reply = await sendMessage(promptChunk, withStreaming, withSuggestions, signal);
} else {
// Add fast reply prompt to the chunk
promptChunk += fastReplyPrompt;
+21
View File
@@ -0,0 +1,21 @@
{
"name": "Default (Dark) 1.7.1",
"blur_strength": 10,
"main_text_color": "rgba(220, 220, 210, 1)",
"italics_text_color": "rgba(145, 145, 145, 1)",
"quote_text_color": "rgba(225, 138, 36, 1)",
"blur_tint_color": "rgba(23, 23, 23, 1)",
"user_mes_blur_tint_color": "rgba(0, 0, 0, 0.9)",
"bot_mes_blur_tint_color": "rgba(0, 0, 0, 0.9)",
"shadow_color": "rgba(0, 0, 0, 1)",
"shadow_width": 2,
"font_scale": 1,
"fast_ui_mode": true,
"waifuMode": false,
"avatar_style": 0,
"chat_display": 0,
"noShadows": true,
"sheld_width": 0,
"timer_enabled": false,
"hotswap_enabled": true
}
+21
View File
@@ -0,0 +1,21 @@
{
"name": "Ross v2",
"blur_strength": 10,
"main_text_color": "rgba(230, 230, 220, 1)",
"italics_text_color": "rgba(145, 145, 145, 1)",
"quote_text_color": "rgba(73, 179, 255, 0.91)",
"blur_tint_color": "rgba(0, 0, 0, 0.5)",
"user_mes_blur_tint_color": "rgba(51, 51, 51, 0.2)",
"bot_mes_blur_tint_color": "rgba(97, 97, 97, 0.43)",
"shadow_color": "rgba(0, 0, 0, 0.5)",
"shadow_width": 2,
"font_scale": 0.95,
"fast_ui_mode": false,
"waifuMode": false,
"avatar_style": 1,
"chat_display": 1,
"noShadows": false,
"sheld_width": 1,
"timer_enabled": true,
"hotswap_enabled": true
}
+7 -4
View File
@@ -357,14 +357,17 @@ app.post("/generate", jsonParser, async function (request, response_generate = r
request.socket.on('close', async function () {
if (request.body.can_abort && !response_generate.finished) {
try {
console.log('Aborting Kobold generation...');
// send abort signal to koboldcpp
await fetch(`${api_server}/extra/abort`, {
const abortResponse = await fetch(`${api_server}/extra/abort`, {
method: 'POST',
});
} catch {
if ('status' in error) {
console.log('Status Code from Kobold:', error.status);
if (!abortResponse.ok) {
console.log('Error sending abort request to Kobold:', abortResponse.status);
}
} catch (error) {
console.log(error);
}
}
controller.abort();
+3 -3
View File
@@ -369,13 +369,13 @@ class Client {
const nextData = JSON.parse(jsonText);
this.formkey = extractFormKey(r.data);
this.viewer = nextData.props.pageProps.payload.viewer;
this.viewer = nextData.props.pageProps.data.viewer;
return nextData;
}
async get_bots() {
const viewer = this.next_data.props.pageProps.payload.viewer;
const viewer = this.next_data.props.pageProps.data.viewer;
if (!viewer.availableBotsConnection) {
throw new Error('Invalid token.');
}
@@ -398,7 +398,7 @@ class Client {
cached_bots[url] = r;
}
const chatData = r.data.pageProps.payload.chatOfBotDisplayName;
const chatData = r.data.pageProps.data.chatOfBotDisplayName;
bots[chatData.defaultBotObject.nickname] = chatData;
resolve();
+8 -8
View File
@@ -3,19 +3,19 @@
if ! command -v npm &> /dev/null
then
read -p "npm is not installed. Do you want to install nodejs and npm? (y/n)" choice
case "$choice" in
y|Y )
case "$choice" in
y|Y )
echo "Installing nvm..."
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc
nvm install lts
nvm use lts;;
n|N )
nvm install --lts
nvm use --lts;;
n|N )
echo "Nodejs and npm will not be installed."
exit;;
* )
* )
echo "Invalid option. Nodejs and npm will not be installed."
exit;;
esac
@@ -28,7 +28,7 @@ if [ ! -z "$REPL_ID" ]; then
fi
echo "Installing Node Modules..."
npm i
npm i --no-audit
echo "Entering SillyTavern..."
node "$(dirname "$0")/server.js"
node "$(dirname "$0")/server.js"