Fix for UI2 download status bar

This commit is contained in:
ebolam
2022-09-19 09:21:08 -04:00
parent ca3db6a05c
commit f5ce00622b
2 changed files with 3 additions and 2 deletions

View File

@@ -1674,7 +1674,7 @@ def patch_transformers_download():
if bar != "":
try:
print(bar, end="")
print(bar, end="\n")
emit('from_server', {'cmd': 'model_load_status', 'data': bar.replace(" ", " ")}, broadcast=True, room="UI_1")
eventlet.sleep(seconds=0)
except:

View File

@@ -207,6 +207,7 @@ def _download_with_aria2(aria2_config: str, total_length: int, directory: str =
if bar is not None:
bar.n = bar.total
bar.close()
koboldai_vars.downloaded_chunks = total
p.terminate()
done = True
break
@@ -221,7 +222,7 @@ def _download_with_aria2(aria2_config: str, total_length: int, directory: str =
for k, v in lengths.items():
if k not in visited:
lengths[k] = (v[1], v[1])
koboldai_vars.downloaded_chunks = sum(v[0] for v in lengths.values())
koboldai_vars.downloaded_chunks += sum(v[0] for v in lengths.values())
bar.n = koboldai_vars.downloaded_chunks
bar.update()
time.sleep(0.1)