diff --git a/endpoints/lollms_webui_infos.py b/endpoints/lollms_webui_infos.py index da83ce5d..f90ffeea 100644 --- a/endpoints/lollms_webui_infos.py +++ b/endpoints/lollms_webui_infos.py @@ -13,11 +13,12 @@ from fastapi import APIRouter, Request import pkg_resources from lollms_webui import LOLLMSWebUI from ascii_colors import ASCIIColors -from lollms.utilities import load_config +from lollms.utilities import load_config, run_async from pathlib import Path from typing import List import sys import socketio +import time # ----------------------- Defining router and main class ------------------------------ # Create an instance of the LoLLMSWebUI class @@ -35,9 +36,9 @@ async def get_lollms_webui_version(): async def restart_program(): """Restart the program.""" # Stop the socketIO server - lollmsElfServer.sio.shutdown() + run_async(lollmsElfServer.sio.shutdown) # Sleep for 1 second before rebooting - lollmsElfServer.sio.sleep(1) + time.sleep(1) # Reboot the program lollmsElfServer.sio.reboot = True @@ -55,7 +56,9 @@ async def update_software(): ASCIIColors.info("") ASCIIColors.info("") # Stop the socketIO server - lollmsElfServer.sio.shutdown() + run_async(lollmsElfServer.sio.shutdown) + # Sleep for 1 second before rebooting + time.sleep(1) # Run the update script using the provided arguments lollmsElfServer.run_update_script(lollmsElfServer.args) diff --git a/lollms_webui.py b/lollms_webui.py index 1e0bd13b..1587996b 100644 --- a/lollms_webui.py +++ b/lollms_webui.py @@ -75,7 +75,7 @@ def terminate_thread(thread): raise SystemError("Failed to terminate the thread.") else: ASCIIColors.yellow("Canceled successfully")# The current version of the webui -lollms_webui_version="9.0 (alpha)" +lollms_webui_version="9.0" @@ -917,8 +917,10 @@ class LOLLMSWebUI(LOLLMSElfServer): message_tokens = full_message_list[i] discussion_messages += self.model.detokenize(message_tokens) - ai_prefix = self.model.detokenize(full_message_list[-1]) - + if len(full_message_list)>0: + ai_prefix = self.model.detokenize(full_message_list[-1]) + else: + ai_prefix = "" # Build the final prompt by concatenating the conditionning and discussion messages prompt_data = conditionning + documentation + knowledge + user_description + discussion_messages + positive_boost + negative_boost + force_language + fun_mode + ai_prefix diff --git a/zoos/bindings_zoo b/zoos/bindings_zoo index 92864fe2..278c53c6 160000 --- a/zoos/bindings_zoo +++ b/zoos/bindings_zoo @@ -1 +1 @@ -Subproject commit 92864fe2e4184689be4b0887a4b8030de507e243 +Subproject commit 278c53c64184e1e033da4623edefaee508d66b2a