From 06ee1426a1b80532186292a2c9f74b7f0b322595 Mon Sep 17 00:00:00 2001 From: ebolam Date: Sat, 22 Oct 2022 21:05:07 -0400 Subject: [PATCH] Progress Bar for UI1 fixed Console print for model loading fixed --- aiserver.py | 9 ++++----- utils.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/aiserver.py b/aiserver.py index a4cce9c9..572a0502 100644 --- a/aiserver.py +++ b/aiserver.py @@ -278,9 +278,9 @@ model_menu = { class Send_to_socketio(object): def write(self, bar): bar = bar.replace("\r", "").replace("\n", "").replace(chr(0), "") - if bar != "": - logger.info(bar) - #print('\r' + bar, end='') + if bar != "" and [ord(num) for num in bar] != [27, 91, 65]: #No idea why we're getting the 27, 1, 65 character set, just killing to so we can move on + #logger.info(bar) + print('\r' + bar, end='') time.sleep(0.01) try: emit('from_server', {'cmd': 'model_load_status', 'data': bar.replace(" ", " ")}, broadcast=True, room="UI_1") @@ -1788,9 +1788,8 @@ def patch_transformers_download(): class Send_to_socketio(object): def write(self, bar): bar = bar.replace("\r", "").replace("\n", "") - logger.debug(bar) - if bar != "": + if bar != "" and [ord(num) for num in bar] != [27, 91, 65]: #No idea why we're getting the 27, 1, 65 character set, just killing to so we can move on try: print('\r' + bar, end='') emit('from_server', {'cmd': 'model_load_status', 'data': bar.replace(" ", " ")}, broadcast=True, room="UI_1") diff --git a/utils.py b/utils.py index dc738e89..ac16d99b 100644 --- a/utils.py +++ b/utils.py @@ -183,7 +183,7 @@ def _download_with_aria2(aria2_config: str, total_length: int, directory: str = def write(self, bar): bar = bar.replace("\r", "").replace("\n", "") - if bar != "": + if bar != "" and [ord(num) for num in bar] != [27, 91, 65]: #No idea why we're getting the 27, 1, 65 character set, just killing to so we can move on try: print('\r' + bar, end='') try: