fixed some bugs

This commit is contained in:
Saifeddine ALOUI 2024-05-13 01:24:50 +02:00
parent 10ccb3ae14
commit 6e61ea4b1f
4 changed files with 13 additions and 12 deletions

View File

@ -54,15 +54,6 @@ def add_events(sio:socketio):
lollmsElfServer.session.get_client(client_id).discussion = lollmsElfServer.db.load_last_discussion()
if lollmsElfServer.personality.welcome_message!="":
if lollmsElfServer.personality.processor:
lollmsElfServer.ShowBlockingMessage("Building custom welcome message.\nPlease standby.")
try:
welcome_message = lollmsElfServer.personality.processor.get_welcome(client)
if welcome_message is not None:
lollmsElfServer.personality.welcome_message = welcome_message
except Exception as ex:
trace_exception(ex)
lollmsElfServer.HideBlockingMessage()
if lollmsElfServer.personality.welcome_audio_path.exists():
for voice in lollmsElfServer.personality.welcome_audio_path.iterdir():
if voice.suffix.lower() in [".wav",".mp3"]:
@ -100,6 +91,16 @@ def add_events(sio:socketio):
else:
welcome_message = lollmsElfServer.personality.welcome_message
if lollmsElfServer.personality.processor:
lollmsElfServer.ShowBlockingMessage("Building custom welcome message.\nPlease standby.")
try:
welcome_message = lollmsElfServer.personality.processor.get_welcome(welcome_message,client)
if welcome_message is None:
welcome_message = lollmsElfServer.personality.welcome_message
except Exception as ex:
trace_exception(ex)
lollmsElfServer.HideBlockingMessage()
try:
nb_tokens = len(lollmsElfServer.model.tokenize(welcome_message))
except:

@ -1 +1 @@
Subproject commit 4734597da2f75eef8963e278b3cfd4b19f20e865
Subproject commit 4155243cbcd8e7c0280dc9fddf0a6433e24ace39

View File

@ -1274,8 +1274,8 @@ class LOLLMSWebUI(LOLLMSElfServer):
self.personality.full(client.generated_text)
except Exception as ex:
trace_exception(ex)
self.close_message(client_id)
self.update_message(client_id, "Generating ...", msg_type=MSG_TYPE.MSG_TYPE_STEP_END)
self.close_message(client_id)
client.processing=False
if client.schedule_for_deletion:

@ -1 +1 @@
Subproject commit 439351e387414828fc5dced5cdc31ff7f0443d4b
Subproject commit 9cab56f8c7f7e08480c9f036ca552d4844a538fb