From 921e76ba11c1acb8301327cb5a9172abd051f5b3 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Wed, 9 Apr 2025 15:55:29 +0200 Subject: [PATCH] fix --- lollms/app.py | 4 ++-- lollms/com.py | 40 +++++++++++++++++++++++----------------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/lollms/app.py b/lollms/app.py index 8b08343..9c57394 100644 --- a/lollms/app.py +++ b/lollms/app.py @@ -1088,7 +1088,7 @@ class LollmsApplication(LoLLMsCom): client.discussion.current_message.nb_tokens = self.model.count_tokens(client.generated_text) except: client.discussion.current_message.nb_tokens = None - client.discussion.current_message.update_db() + # client.discussion.current_message.update() await self.sio.emit( "close_message", { @@ -1107,7 +1107,7 @@ class LollmsApplication(LoLLMsCom): to=client_id, ) else: - client.discussion.current_message.update_db() + # client.discussion.current_message.update_db() await self.sio.emit( "close_message", { diff --git a/lollms/com.py b/lollms/com.py index 999ed0e..230dedc 100644 --- a/lollms/com.py +++ b/lollms/com.py @@ -68,25 +68,31 @@ class LoLLMsCom: print(f"ERROR: Loop not available when trying to schedule {coro}") def InfoMessage(self, content, client_id=None, verbose:bool=None): - self.schedule_task( self.notify( - content, - notification_type=NotificationType.NOTIF_SUCCESS, - duration=0, - client_id=client_id, - display_type=NotificationDisplayType.MESSAGE_BOX, - verbose=verbose + try: + self.schedule_task( self.notify( + content, + notification_type=NotificationType.NOTIF_SUCCESS, + duration=0, + client_id=client_id, + display_type=NotificationDisplayType.MESSAGE_BOX, + verbose=verbose + ) ) - ) + except: + ASCIIColors.info(content) def ShowBlockingMessage(self, content, client_id=None, verbose:bool=None): - self.schedule_task( self.notify( - content, - notification_type=NotificationType.NOTIF_SUCCESS, - duration=0, - client_id=client_id, - display_type=NotificationDisplayType.SHOW_BLOCKING_MESSAGE, - verbose=verbose - ) - ) + try: + self.schedule_task( self.notify( + content, + notification_type=NotificationType.NOTIF_SUCCESS, + duration=0, + client_id=client_id, + display_type=NotificationDisplayType.SHOW_BLOCKING_MESSAGE, + verbose=verbose + ) + ) + except: + ASCIIColors.info(content) def HideBlockingMessage(self, client_id=None, verbose:bool=None): self.schedule_task( self.notify(