From 5b68c2d64d5cde0067e02a14e362be1ea8bb751d Mon Sep 17 00:00:00 2001 From: ebolam Date: Sat, 1 Oct 2022 16:12:59 -0400 Subject: [PATCH] Optimization --- koboldai_settings.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koboldai_settings.py b/koboldai_settings.py index 3a89b5d2..99044bec 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -1510,14 +1510,16 @@ class KoboldWorldInfo(object): if uid is not None: if uid in self.world_info: self.world_info[uid]['token_length'] = len(self.tokenizer.encode(self.world_info[uid]['content'])) + self.socketio.emit("world_info_entry", self.world_info[uid], broadcast=True, room="UI_2") else: for uid in self.world_info: self.world_info[uid]['token_length'] = len(self.tokenizer.encode(self.world_info[uid]['content'])) + self.send_to_ui() else: for uid in self.world_info: self.world_info[uid]['token_length'] = 0 + self.send_to_ui() - self.send_to_ui() def add_folder(self, folder): if folder in self.world_info_folder: