From 70f01e0b8bd591ecb1027d5f146ac262af6beaf0 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Fri, 15 Mar 2024 20:56:02 +0100 Subject: [PATCH] upgrading --- lollms/server/events/lollms_personality_events.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lollms/server/events/lollms_personality_events.py b/lollms/server/events/lollms_personality_events.py index 4f62fc5..52826dc 100644 --- a/lollms/server/events/lollms_personality_events.py +++ b/lollms/server/events/lollms_personality_events.py @@ -82,16 +82,18 @@ def add_events(sio:socketio): path:Path = client.discussion.discussion_text_folder path.mkdir(parents=True, exist_ok=True) - file_path = path / filename + file_path:Path = path / filename try: if chunk_index==0: + lollmsElfServer.ShowBlockingMessage(f"Importing File {file_path.name}") with open(file_path, 'wb') as file: file.write(chunk) else: with open(file_path, 'ab') as file: file.write(chunk) except Exception as e: + lollmsElfServer.HideBlockingMessage() print(f"Error writing to file: {e}") return @@ -104,6 +106,7 @@ def add_events(sio:socketio): ASCIIColors.success('File processed successfully') run_async(partial(sio.emit,'file_received', {'status': True, 'filename': filename})) + lollmsElfServer.HideBlockingMessage() else: run_async(partial(sio.emit,'request_next_chunk', {'offset': offset + len(chunk)}))