Merge pull request #27 from henk717/united

Merge united
This commit is contained in:
Llama
2023-03-26 23:25:36 -07:00
committed by GitHub
2 changed files with 22 additions and 8 deletions

View File

@@ -13,6 +13,19 @@
{
"cell_type": "markdown",
"source": [
"# GOOGLE HAS BROKEN SUPPORT FOR MESH TRANSFORMERS JAX IN THEIR DRIVER, THIS MESSAGE WILL BE REMOVED ONCE THE NOTEBOOK WORKS AGAIN\n",
"---\n",
"Are you a developer familair with Jax? We could use some help.\n",
"Our Mesh Transformers Jax fork resides here (but unfortunately VE-Forbryderne has gone missing) : https://github.com/VE-FORBRYDERNE/mesh-transformer-jax\n",
"\n",
"This is combined with the TPU backend code you can find here: https://github.com/KoboldAI/KoboldAI-Client/blob/main/tpu_mtj_backend.py\n",
"\n",
"So far we know the driver initialization issues can be resolved when a newer version of Jax is used combined with a slight edit to tpu_mtj_backend.py to use Jax's built in code for driver intialization (Which is not present in the older version we currently use, hence that part being in our file).\n",
"\n",
"As far as we understand the issue is that xmap was broken in newer versions, and MTJ makes use of it. If someone can port this part of the code to be compatible with the newer Jax versions you can save this notebook!\n",
"\n",
"(Or Google, if you are reading this. Please reintroduce the old 0.1 compatibility since you broke an entire ecosystem of Mesh Transformers Jax users, which has historic value because it is the original implementation of GPT-J. There also do not seem to be alternatives that have the same amount of performance and model compatibility).\n",
"\n",
"# Welcome to KoboldAI on Google Colab, TPU Edition!\n",
"KoboldAI is a powerful and easy way to use a variety of AI based text generation experiences. You can use it to write stories, blog posts, play a text adventure game, use it like a chatbot and more! In some cases it might even help you with an assignment or programming task (But always make sure the information the AI mentions is correct, it loves to make stuff up).\n",
"\n",

View File

@@ -2260,16 +2260,16 @@ class KoboldWorldInfo(object):
self._socketio.emit("world_info_folder", {x: self.world_info_folder[x] for x in self.world_info_folder}, broadcast=True, room="UI_2")
def delete_folder(self, folder):
if folder == "root":
raise Exception("removing the root folder is not supported")
keys = [key for key in self.world_info]
for key in keys:
if self.world_info[key]['folder'] == folder:
self.delete(key)
if folder in self.world_info_folder:
del self.world_info_folder[folder]
self.sync_world_info_to_old_format()
if self._socketio is not None:
self._socketio.emit("delete_world_info_folder", folder, broadcast=True, room="UI_2")
self._socketio.emit("world_info_folder", {x: self.world_info_folder[x] for x in self.world_info_folder}, broadcast=True, room="UI_2")
logger.debug("Calcing AI Text from WI Folder Delete")
ignore = self._koboldai_vars.calc_ai_text()
@@ -2446,9 +2446,6 @@ class KoboldWorldInfo(object):
self._socketio.emit("world_info_entry", self.world_info[uid], broadcast=True, room="UI_2")
def delete(self, uid):
if self.world_info[uid]['folder'] == "root":
raise Exception("removing the root folder is not supported")
del self.world_info[uid]
try:
@@ -2470,8 +2467,6 @@ class KoboldWorldInfo(object):
ignore = self._koboldai_vars.calc_ai_text()
def rename_folder(self, old_folder, folder):
if old_folder == "root":
raise Exception("renaming the root folder is not supported")
self.story_settings.gamesaved = False
if folder in self.world_info_folder:
i=0
@@ -2498,7 +2493,8 @@ class KoboldWorldInfo(object):
self.story_settings.gamesaved = False
self.sync_world_info_to_old_format()
if self._socketio is not None:
self._socketio.emit("world_info_folder", {x: self.world_info_folder[x] for x in self.world_info_folder}, broadcast=True, room="UI_2")
self._socketio.emit("delete_world_info_folder", old_folder, broadcast=True, room="UI_2")
self.send_to_ui()
def reorder(self, uid, before):
self.add_item_to_folder(uid, self.world_info[before]['folder'], before=before)
@@ -2576,6 +2572,11 @@ class KoboldWorldInfo(object):
def sync_world_info_to_old_format(self):
#Since the old UI uses world info entries for folders, we need to make some up
if "root" not in self.world_info_folder:
old_world_info_folder = self.world_info_folder
self.world_info_folder = OrderedDict()
self.world_info_folder["root"] = []
self.world_info_folder.update(old_world_info_folder)
folder_entries = {}
i=-1
for folder in self.world_info_folder: