From f8db177ca75469ad2cb59e114e846342bf4e53a9 Mon Sep 17 00:00:00 2001 From: FunkEngine <123712145+FunkEngine2023@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:26:34 -0500 Subject: [PATCH 01/17] PowerShell is a shell f its former self... Truly. --- CONSOLE.lnk | Bin 1797 -> 1879 bytes FIX_EXEC-POL-ERROR.lnk | Bin 1921 -> 1971 bytes Start.bat | 3 ++- TAVERN_CONSOLE.lnk | Bin 1873 -> 1923 bytes 4 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONSOLE.lnk b/CONSOLE.lnk index 8a038e724fdbd0278b0ac3e9a0dcaadce62f7dc6..c9566de210ba3aecaee3e878f9d80d74a36fffed 100644 GIT binary patch delta 452 zcmZqWyUsU3L}|AI2ZI6w1B0}%R$s8a%nV}M>A`~c6#E{BR43sYdiSWhv-xU`;f|996oM;@ zOHy-?Gq`>c9gsLkzcEOe$mElZg6v1w7&<+DL?%CERAX$K%)wN| z3buE0J(C8b{p58_nn*T0U<%*d%-q1Fpb9kODiF&6F*gIlf^xruQqP%U{kFU4ZCn>P zWBX)fHk11PSAkiND&GnA^ysKxU%yW8k?7Y*|6UQ7&O`hnvoDCXqRXEF8pZ@PjGf^t x!wLp|^%V@tKoMjh1oR98!ycd_XNG)+JceQ*nZu9>q#5A6RImo1lF8TD8Uel_Y*zpP diff --git a/FIX_EXEC-POL-ERROR.lnk b/FIX_EXEC-POL-ERROR.lnk index 82e08db982b3a6dd5c68abc859dc041569610975..e8a9daa3e0fa3c19f97470b6ef865a4ed587033c 100644 GIT binary patch delta 367 zcmZqV-^@QjL}|4G2ZI6w1B0}%*uqP%Z*UgFsqoUUqz1PGSLs v%kW6_Yovd#h)d@oev#Q1#9DVY)nwf6eJi*p<+twNEj&}P$P1z<0GR^-rA}`! delta 379 zcmdnY-^f2fL}|AI2ZI6w1H-R(mbdokU1NmND=x7eI1+e?k>SWhv-xU`;f|996oM;@ zOHy-?Gq`>c9gsLkzcEOe$mElZg6v1w7&<+DL?%CERAX$K%)wN| z3buE0JyQgd*$s{?`%Lu$Kyz6c7#64k z>8n621H{}we!1U4spm|we%oF2Hm(btu^l9r0L08dxd-4b5^P(u29L{!z1!NcivwmSWhv-xU`;f|996oM;@ zOHy-?Gq`>c9gsLkzcEOe$mElZg6v1w7&<+DL?%CERAX$K%)wN| z3buE0JyQgd*$s{??M(HmKy$AGu?!G% zGcYVD_d6){oGI3CyNlk&b%8UsgX9u`m>DP+0i;17B(W^DC@FYdzgNVi n^ANwt> Date: Thu, 4 Jan 2024 01:02:49 +0000 Subject: [PATCH 02/17] Respect configured address binding. Don't use weird side effects that override user explicit settings. --- config.conf | 2 +- server.js | 35 ++++++++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/config.conf b/config.conf index e5cee594..8e1f37c8 100644 --- a/config.conf +++ b/config.conf @@ -10,7 +10,7 @@ const characterFormat = 'png'; // webp or png const charaCloudServer = 'https://tavernai.net'; //'https://tavernai.net'; http://127.0.0.1 -const listenIp = '127.0.0.1'; // The IP address to which the socket is bound. This is an advanced setting; do not modify the setting unless you have knowledge of networking. +const listenIp = null; // The IP address to which the socket is bound, set automatically if left as null. This is an advanced setting; do not modify the setting unless you have knowledge of networking. const connectionTimeoutMS = 2*60*1000; // (2 mintues, change the first number if you have a really slow local API.) The maximum duration of the request, after which TAI assumes the server will not reply at all (default is 2 minutes) diff --git a/server.js b/server.js index 020c38b4..6daf7106 100644 --- a/server.js +++ b/server.js @@ -40,11 +40,38 @@ const config = require(path.join(process.cwd(), './config.conf')); const server_port = config.port; const whitelist = config.whitelist; const whitelistMode = config.whitelistMode; -let listenIp = config.listenIp || '127.0.0.1'; - -if(!whitelistMode || whitelist.length > 1){ +let listenIp = null; + +if (config.listenIp) { + // If an advanced user has set the listen IP we use it explicitly + listenIp = config.listenIp; +} else if (!whitelistMode || whitelist.length > 1) { + // If whitelist mode is disabled or there are multiple IPs in the whitelist + // we listen on all interfaces. + + // This logic is a bit weird, if white list mode is disabled, why would + // you want to make your server available on all interfaces by default? + // I suppose if you specify multiple IPs in the whitelist, it's probably + // because you have multiple interfaces and you want to make the server + // available only on those interfaces? This sounds like an advanced use case + // to me, but I'm keeping the logic as it was in the original code for now. listenIp = '0.0.0.0'; +} else { + // Otherwise we listen on the loopback address only + listenIp = '127.0.0.1'; } + +if (!whitelistMode && ipaddr.parse(listenIp).range() !== 'loopback') { + console.warn( +`WARNING: You have configured TavernAI to listen on an IP address that + is not a loopback address ('${listenIp}'), and you have not enabled + white list mode. This means that your TavernAI server will be + accessible from other computers on your network. If you do not want + this, please change the listenIp setting in your config.conf file or + enable and configure white list mode.` + ); +} + const autorun = config.autorun; const characterFormat = config.characterFormat; const charaCloudMode = config.charaCloudMode; @@ -2678,6 +2705,7 @@ module.exports.charactersPath = charactersPath; const charaCloudRoute = require('./routes/characloud'); const e = require('express'); +const { listen } = require('express/lib/application'); app.use('/api/characloud', charaCloudRoute); @@ -2699,6 +2727,7 @@ app.listen(server_port, listenIp, function() { ); if(autorun) open(autorunUrl.toString()); console.log('TavernAI has started and is available on IP: 127.0.0.1 at PORT: '+server_port); + console.log('TavernAI is bound to interface: ' + listenIp) }); function initializationCards() { From 28db7166395393c162bbd5b47067eeea5e0a8c45 Mon Sep 17 00:00:00 2001 From: ExZyle Date: Thu, 4 Jan 2024 22:08:21 +0000 Subject: [PATCH 03/17] Remove WIP comments. --- server.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/server.js b/server.js index 6daf7106..ee42b345 100644 --- a/server.js +++ b/server.js @@ -46,15 +46,8 @@ if (config.listenIp) { // If an advanced user has set the listen IP we use it explicitly listenIp = config.listenIp; } else if (!whitelistMode || whitelist.length > 1) { - // If whitelist mode is disabled or there are multiple IPs in the whitelist + // If whitelist mode is disabled OR there are multiple IPs in the whitelist // we listen on all interfaces. - - // This logic is a bit weird, if white list mode is disabled, why would - // you want to make your server available on all interfaces by default? - // I suppose if you specify multiple IPs in the whitelist, it's probably - // because you have multiple interfaces and you want to make the server - // available only on those interfaces? This sounds like an advanced use case - // to me, but I'm keeping the logic as it was in the original code for now. listenIp = '0.0.0.0'; } else { // Otherwise we listen on the loopback address only From 17c93c6febf240126146ffa525fa78f43d0315a7 Mon Sep 17 00:00:00 2001 From: ExZyle Date: Thu, 4 Jan 2024 22:22:28 +0000 Subject: [PATCH 04/17] Remove stray line. --- server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/server.js b/server.js index ee42b345..3b72da2d 100644 --- a/server.js +++ b/server.js @@ -2698,7 +2698,6 @@ module.exports.charactersPath = charactersPath; const charaCloudRoute = require('./routes/characloud'); const e = require('express'); -const { listen } = require('express/lib/application'); app.use('/api/characloud', charaCloudRoute); From a57140d76e98296c3803622a0fda5d265e410bf1 Mon Sep 17 00:00:00 2001 From: ufeike <135261141+ufeike@users.noreply.github.com> Date: Sat, 6 Jan 2024 12:20:17 +0700 Subject: [PATCH 05/17] Brought back the option to choose gpt-3.5-turbo-0301 --- public/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 7f343a74..5c917248 100644 --- a/public/index.html +++ b/public/index.html @@ -712,7 +712,8 @@

Model

gpt-4-32k - + + From 7f19f3fa0a98c2ca45af056d89d51e2aef5b2872 Mon Sep 17 00:00:00 2001 From: FunkEngine <123712145+FunkEngine2023@users.noreply.github.com> Date: Sat, 6 Jan 2024 09:44:36 -0500 Subject: [PATCH 06/17] FEEDBACK PLEASE! --- colab/TAI+KCpp_RC_2_0.ipynb | 547 ++++++++++++++++++++++++++++++++++++ 1 file changed, 547 insertions(+) create mode 100644 colab/TAI+KCpp_RC_2_0.ipynb diff --git a/colab/TAI+KCpp_RC_2_0.ipynb b/colab/TAI+KCpp_RC_2_0.ipynb new file mode 100644 index 00000000..8bbda23c --- /dev/null +++ b/colab/TAI+KCpp_RC_2_0.ipynb @@ -0,0 +1,547 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "source": [ + "# @title { run: \"auto\", form-width: \"125%\", display-mode: \"form\" }\n", + "#@markdown\n", + "from google.colab import output\n", + "# ♫♪ There's something happening here. ♫♪\n", + "from IPython.core.display import display, HTML\n", + "# ♫♪ But what it is ain't exactly clear... ♫♪\n", + "from google.colab.output import clear\n", + "# ♫♪ There's a man and a nun over there??? ♫♪\n", + "class InvokeButton1(object):\n", + " def __init__(self, title, callback):\n", + " self._title = title\n", + " self._callback = callback\n", + " def _repr_html_(self):\n", + " callback_id = 'button1'\n", + " output.register_callback(callback_id, self._callback)\n", + " template = \"\"\"\n", + " \"\"\"\n", + " html = template.format(title=self._title, callback_id=callback_id)\n", + " return html\n", + "# ♫♪ Throwing cheese... ♫♪ up in the air!?! ♫♪\n", + "def user_pulled_a_henky():\n", + " output.clear(output_tags='F5')\n", + " with output.use_tags(tags='F5'):\n", + " display(HTML('